参考文档: http://dev.mysql.com/doc/refman/5.6/en/linux-installation-yum-repo.html
1. 下载 rpm 文件:
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
2. 安装 rpm 文件
sudo yum localinstall mysql-community-release-el6-5.noarch.rpm
3. 检查 rpm 是否已经安装成功:
yum repolist enabled | grep "mysql.*-community.*"
4. 安装 mysql
sudo yum install mysql-community-server
5. 启动 mysql
sudo service mysqld start
6. 停止 mysql
sudo service mysqld stop
7. 执行安全设定
mysql_secure_installation
8. 远程登录设置(假设root密码为mypassword)
mysql -u root -pmypassword)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;