Install mysql5.7 by ‘yum’

环境:腾讯云CentOS7

1.首先获取rpm:

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

2.安装rpm:

yum install mysql57-community-release-el7-8.noarch.rpm

3.通过yum repolist查看:

yum repolist enabled | grep “mysql.*-community.*”

4.安装mysql:

yum install mysql-community-server

5.打开mysql:

systemctl start mysqld.service

6.查看登录密码:

grep “password” /var/log/mysqld.log

7.进入mysql后修改密码:

use mysql;

alter user ‘root’@’localhost’ identified by ‘newpassword’;

flush privileges;

如果遇到报错:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements,解决方案:set global validate_password_policy=0;再使用上面的alter语句修改密码。

8.修改my.cnf:

在[mysqld]里添加:

character-set-server = utf8

在最下方添加:

[client]

default-character-set = utf8

9.重启mysql:systemctl restart mysqld.service

“Install mysql5.7 by ‘yum’”的2个回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注