hellow 运维
分类: 系统运维
2015-06-16 15:57:06
[1]下载源码包
1
|
http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz
|
[2]必要软件包
1
|
yum-yinstall gccgcc-c++gcc-g77autoconfautomakezlib*fiex*libxml*ncurses-devellibmcrypt*libtool-ltdl-devel*makecmake
[3]编译安装 |
|
[root@localhost]# groupadd mysql
[root@localhost]# useradd -r -g mysql mysql
[root@localhost]# tar -zxvf mysql-5.6.14.tar.gz
[root@localhost]# cd mysql-5.6.14
[root@localhost]# cmake .
[root@localhost]# make && make install
[root@localhost]# chown -R mysql.mysql /usr/local/mysql
[root@localhost]# cd /usr/local/mysql/scripts
[root@localhost]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@localhost]# cd /usr/local/mysql/support-files
[root@localhost]# cp mysql.server /etc/rc.d/init.d/mysql
[root@localhost]# cp my-default.cnf /etc/my.cnf
[root@localhost]# chkconfig --add mysql
[root@localhost]# chkconfig mysql on
[root@localhost]# service mysql start
[root@localhostmysql]# service mysql start
StartingMySQL..ERROR!TheserverquitwithoutupdatingPIDfile(/usr/local/mysql/data/localhost.pid).
[root@localhost support-files]# ps -ef | grep mysqld | grep -v grep
mysql 3563 1 0 Jun15 pts/1 00:00:04 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
[root@localhost]# kill -9 3563
[root@localhost]# service mysql start
[root@localhost]# /usr/local/mysql/bin/mysql -u root -p
Enterpassword:为空
mysql>SETPASSWORDFOR'root'@'localhost'=PASSWORD('123456');
QueryOK,0rowsaffected(0.00sec)
|