卸载已经安装过的旧版本mysqlrpm -e mysql
rpm -e --nodeps mysql
yum remove mysql
安装MySql
安装mysql依赖包yum -y install make gcc-c++ cmake bison-devel ncurses-devel
下载mysql5.6.33
网址http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/wget http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/mysql-5.6.33.tar.gz
tar -zxvf mysql-5.6.33.tar.gz
cd mysql-5.6.33
编译安装cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysqldb -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_ci
make && make install
配置mysqlchown -R mysql:mysql /usr/local/mysql
mkdir -p /data/mysqldb
chown -R mysql:mysql /data
mv /etc/my.cnf /etc/my.bak
初始化mysqlcd /usr/local/mysql
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysqldb --user=mysql
启动mysqlcp support-files/mysql.server /etc/init.d/mysqld
chkconfig mysql on
service mysql start
mysql环境变量配置PATH=/usr/local/mysql/bin:$PATH
export PATH
source /etc/profile
设置root登录口令mysql -uroot
mysql> SET PASSWORD = PASSWORD(‘123456‘);
Centos6.5 源码安装MySql5.6.33
标签:mysql源码安装
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:http://linuxinfo.blog.51cto.com/412748/1866426