wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld.service
查看状态:
systemctl status mysqld.service
修改mysql密码:
grep "password" /var/log/mysqld.log
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Rt123321#db';
开启mysql的远程访问:
grant all privileges on . to 'root'@'%' identified by 'Rt123321#db' with grant option;
flush privileges;
exit;
更改mysql的语言:
vi /etc/my.cnf
开头添加内容:
[client]
default-character-set=utf8
结尾添加内容:
character-set-server=utf8
collation-server=utf8_general_ci
重启mysql:
systemctl restart mysqld.service