mysql 5.6.13 源码安装

centos 5.6 x86_64


首先你需要安装一下所需要的包:

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


然后 添加用户:

# groupadd mysql

# useradd -r -g mysql mysql


进行编译安装

# tar -zxvf mysql-5.6.13.tar.gz

# cd mysql-5.6.13

[root@xbz mysql-5.6.13]# cmake .

[root@xbz mysql-5.6.13]# make && make install

我这里比较简单 ,当然你可以设置很详细的编译参数;默认情况下是被安装在/usr/local/mysql

[root@xbz ~]# chown -R mysql.mysql /usr/local/mysql

[root@xbz ~]# cd /usr/local/mysql/scripts

[root@xbz ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

[root@xbz~]# cd /usr/local/mysql/support-files

[root@xbz support-files]# cp mysql.server /etc/rc.d/init.d/mysql

[root@xbz support-files]# cp my-default.cnf /etc/my.cnf
[root@xbz support-files]# vim /etc/my.cnf
[mysql]
socket=/tmp/mysql.sock

# chkconfig -add mysql

# chkconfig mysql on

# service mysql start
# mysql (或者你设置了密码 mysql -uroot -p)


你可能感兴趣的:(mysql)