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

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

#groupadd mysql

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

#yum -y install cmake

#wget mysql-5.5.21.tar.gz

#tar zxvf mysql-5.5.21.tar.gz

#cd mysql-5.5.21

#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

#make && make install

#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