CentOS 7 安装mysql

主要使用Rails 搭配PG,但是经常要帮人搭建Mysql环境。
CentOS 7默认搭配的是MariaDB,为防止踩坑,还是安装官方Mysql。

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
#更新yum软件包
yum check-update  

#更新系统 
yum update
 #安装mysql
yum install mysql mysql-server 
启动
systemctl start mysqld
mysql -u root
#授权远程访问
use mysql;
grant all privileges  on *.* to root@'%' identified by "root";
FLUSH RIVILEGES;

你可能感兴趣的:(CentOS 7 安装mysql)