当前位置: 代码迷 >> 综合 >> Mysql 5.6 Cmake 编译安装
  详细解决方案

Mysql 5.6 Cmake 编译安装

热度:119   发布时间:2023-11-06 10:45:10.0

MySQL编译安装

环境:
  OS: CentOS 6.6x64 mini
  mysql: mysql-5.6.25
1. mysql 下载:
 http://dev.mysql.com/downloads/mysql/

  下载地址: wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.43.tar.gz

2.安装

setenforce 0       //禁用selinuxyum install cmake wget gcc-c++ gcc ncurses-devel -ygroupadd mysqluseradd -g mysql mysqltar xvf  mysql-5.6.25.tar.gz cd mysql-5.6.25 cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_cimakemake install

安装完成,配置权限

cd /usr/local/mysqlchown -R mysql .chgrp -R mysql .yum -y install autoconfscripts/mysql_install_db --user=mysqlchown -R root .chown -R mysql data

 注  如若报错 :

curl -L http://xrl.us/installperlnix | bash

 启动脚本

cp support-files/mysql.server /etc/init.d/mysql.server

启动数据库

/usr/local/mysql/scripts/mysql_install_db --user=mysqlservice mysql.server startmysql -uroot -p 
输入密码  空 回车

 

  相关解决方案