參考文檔: http://dev.mysql.com/doc/refman/5.6/en/linux-installation-yum-repo.htmlhtml
1. 下載 rpm 文件:
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpmmysql
2. 安裝 rpm 文件
sudo yum localinstall mysql-community-release-el6-5.noarch.rpmlinux
3. 檢查 rpm 是否已經安裝成功:
yum repolist enabled | grep "mysql.*-community.*"sql
4. 安裝 mysql
sudo yum install mysql-community-server
5. 啓動 mysql
sudo service mysqld start安全
6. 中止 mysql
sudo service mysqld stopserver
7. 執行安全設定
mysql_secure_installationhtm
8. 遠程登陸設置(假設root密碼爲mypassword)文檔
mysql -u root -pmypassword)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;get