下面介绍下在CentOS-6.4安装MySQL-5.6.14。

[1]下载源码包<!--more-->

[root@PHPHa ~]# http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz

[2]必要软件包

[root@PHPHa ~]# yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake

[3]编译安装

[root@PHPHa ~]# groupadd mysql
[root@PHPHa ~]# useradd -r -g mysql mysql
[root@PHPHa ~]# tar -zxvf mysql-5.6.14.tar.gz
[root@PHPHa ~]# cd mysql-5.6.14
[root@PHPHa ~]# cmake .
[root@PHPHa ~]# make &amp;&amp; make install
[root@PHPHa ~]# chown -R mysql.mysql /usr/local/mysql
[root@PHPHa ~]# cd /usr/local/mysql/scripts
[root@PHPHa ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@PHPHa ~]# cd /usr/local/mysql/support-files
[root@PHPHa ~]# cp mysql.server /etc/rc.d/init.d/mysql
[root@PHPHa ~]# cp my-default.cnf /etc/my.cnf
[root@PHPHa ~]# chkconfig --add mysql
[root@PHPHa ~]# chkconfig mysql on
[root@PHPHa ~]# service mysql start
[root@localhost mysql]# service mysql start
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.pid).
[root@PHPHa ~]# ps -ef | grep mysqld
[root@PHPHa ~]# root     19897 19401  0 15:04 pts/0    00:00:00 grep msyqld
[root@PHPHa ~]# kill 19897
[root@PHPHa ~]# service mysql start
[root@PHPHa ~]# /usr/local/mysql/bin/mysql -u root -p -S /tmp/mysql.sock
Enter password:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
Query OK, 0 rows affected (0.00 sec)

标签:MySQL / CentOS