centos 编译安装mysql

必要软件包
 

yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake

编译安装

groupadd mysql
useradd -r -g mysql mysql
tar -zxvf mysql-5.6.10.tar.gz
cd mysql-5.6.10
cmake .
make && make install
-------------------------默认情况下是安装在/usr/local/mysql
chown -R mysql.mysql /usr/local/mysql
cd /usr/local/mysql/scripts
./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
cd /usr/local/mysql/support-files
cp mysql.server /etc/rc.d/init.d/mysql
cp my-default.cnf /etc/my.cnf
chkconfig -add mysql
chkconfig mysql on
service mysql start

你可能感兴趣的:(centos 编译安装mysql)