一、下載地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 選擇「Source Code」,html
用已經註冊好的oracle帳戶登陸後才能下載,下載版本爲mysql-5.6.15.tar.gz,也就是上圖的最後一個包。python
2:必要軟件包mysql
3:安裝編譯【注意,xzvf和zxvf安裝的路徑是不用的】c++
[root@server182 ~]# groupadd mysql [root@server182 ~]# useradd -r -g mysql mysql [root@server182 ~]# tar -zxvf mysql-5.6.10.tar.gz [root@server182 ~]# cd mysql-5.6.10 [root@server182 mysql-5.6.10]# cmake . [root@server182 mysql-5.6.10]# make && make install -------------mysql默認被zxvf安裝在/usr/local下,xzvf被安裝在tar包所在的路徑下 [root@server182 ~]# chown -R mysql.mysql /usr/local/mysql
[root@server182 /usr/local/mysql]# chown -R root .
[root@server182 /usr/local/mysql]#chown -R mysql data
[root@server182 /usr/local/mysql]#chgrp -R mysql .
[root@server182 ~]# cd /usr/local/mysql/scripts [root@server182 ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data -------------所有OK,沒有報錯,說明成功了 [root@server182 ~]# cd /usr/local/mysql/support-files [root@server182 support-files]# cp mysql.server /etc/rc.d/init.d/mysqld [root@server182 support-files]# cp my-default.cnf /etc/my.cnf [root@localhost support-files]# chkconfig mysqld on [root@localhost support-files]# service mysqld start Starting MySQL SUCCESS! [root@localhost support-files]# cd /usr/local/mysql/bin/ [root@localhost bin]# ./mysqladmin -u root -p password Enter password: 直接按回車 New password: 輸入新密碼 Confirm new password:再次輸入新密碼 [root@localhost bin]# ./mysql -u root -p 【登陸mysql平臺】 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456789' WITH GRANT OPTION; mysql>quit; 開啓防火牆的3306 [root@localhost bin]# vi /etc/sysconfig/iptables 在COMMIT前面加上 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT service iptables restart
CMake has bootstrapped.Now run gmake.說明CMake已被設置爲開機啓動,如今運行gmake。sql