linux下用cmake编译安装mysql-5.6.4-m7

从官网下载了一个最新版的mysql源码包mysql-5.6.4-m7.tar.zip,准备安装一下,可是解压出来,却发现无法./configure。后来才知道mysql现在用cmake了。

这里贴一下cmake编译安装mysql的方法:

#groupadd mysql

#useradd -g mysql mysql -s /sbin/nologin

#sudo apt-get install cmake

#tar zxvf mysql-5.6.4-m7.tar.gz

#cd mysql-5.6.4-m7

#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql

-DMYSQL_DATADIR=/usr/local/mysql/data

-DWITH_MYISAM_STORAGE_ENGINE=1

-DWITH_INNOBASE_STORAGE_ENGINE=1

-DWITH_ARCHIVE_STORAGE_ENGINE=1

-DWITH_BLACKHOLE_STORAGE_ENGINE=1

-DENABLED_LOCAL_INFILE=1

-DDEFAULT_CHARSET=utf8

-DDEFAULT_COLLATION=utf8_general_ci

-DEXTRA_CHARSETS=all

-DMYSQL_TCP_PORT=3306

-DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysqld.sock

-DSYSCONFDIR=/usr/local/mysql/etc/my.cnf

-DWITH_DEBUG=0

#sudo make && make install

#sudo mkdir -p /usr/local/mysql/etc

#cp support-files/my-medium.cnf /usr/local/mysql/etc/my.cnf

#chmod 755 /usr/local/mysql/scripts/mysql_install_db

#chown -R mysql.mysql /usr/local/mysql/

#/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

#/usr/local/mysql/bin/mysqld_safe  --user=mysql &

#/usr/local/mysql/bin/mysqladmin -uroot password 123456

#/usr/local/mysql/bin/mysql -uroot -p123456

#echo "/usr/local/mysql/bin/mysqld_safe --user=mysql &" >>/etc/rc.local

#echo "export PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile

#source /etc/profile

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。