1.下載MySQL5.6源碼包 mysql
2.解壓 tar -zxvf mysql*****.tar.gz 壓縮包與tar後的文件不要放在一個目錄中 sql
cp -vRp mysql*** /usr/local/mysql ui
4.添加mysql組 groupadd mysql 加密
5.添加mysql用戶 useradd -r -g mysql mysql es5
sudo apt-get install build-essential gcc g++ libncurses5-dev spa
sudo apt-get install Bison server
-DENABLE_DOWNLOADS=1 ip
9.make ci
10.make install get
11.設置MySQL安裝目錄權限 chown -R mysql:mysql /usr/local/mysql
12.查看scripts/mysql_install_db的權限 ls -l scripts/mysql_install_db
若是沒有x權限,則 chmod +x /usr/local/mysql/scripts/mysql_install_db
13.初始化MySQL scripts/mysql_install_db --user=mysql
14.複製權限文件 cp support-files/mysql.server /etc/init.d/mysqld
15.重命名權限文件 mv /etc/init.d/mysqld/mysql.server /etc/init.d/mysqld/mysqld.server
16.修改MySQL安裝目錄權限 chown -R root /usr/local/mysql
17.修改mysql/data目錄權限 chown -R mysql /usr/local/mysql/data
18.啓動MySQL bin/mysqld_safe --user=mysql &
19.進入mysql bin/mysql -u root
20.給root用戶添加密碼 bin/mysqladmin -u root password 'root'
21.複製my.cnf配置文件 cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf