Linux(CENTOS7) YUM方式安装mysql5.7

  参考地址:https://www.cnblogs.com/linjiqin/p/7611204.html

  注:该地址标题写的是CENTOS6.*版本的,但是我在我的CENTOS7.*上面安装是完美进行的

  下面的内容是我从上面这个地址复制过来的,稍作修改。

下载mysql源安装包
# wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 安装mysql源包
# yum localinstall mysql57-community-release-el7-.noarch.rpm 检查mysql源是否安装成功
# yum repolist enabled | grep "mysql.*-community.*" 看到下图(三个)表示成功:
mysql-connectors-community MySQL Connectors Community
mysql-tools-community MySQL Tools Community
mysql57-community MySQL5. Community Server 安装MySQL服务
# yum install mysql-community-server 启动MySQL服务
# systemctl start mysqld 查看MySQL的启动状态
# systemctl status mysqld 设置开机启动
# systemctl enable mysqld
# systemctl daemon-reload #重新载入 查看root默认密码
# grep 'temporary password' /var/log/mysqld.log 修改root密码
# mysql -uroot -p mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc1234!';
或者
mysql> set password for'root'@'localhost'=password('Abc1234!'); 注意:mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR (HY000): Your passworddoes not satisfy the current policy requirements错误 添加远程连接登录用户,如:用户名:root,密码:Abc1234!
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'Abc1234!' WITH GRANT OPTION; 重启mysql服务
# systemctl restart mysqld 我这里使用SQLyog链接的,如果链接报类似下面错误:
Host ‘’ is not allowed to connect to this MySQL server
请参考下面链接:https://blog.csdn.net/liguoqingxjxcc/article/details/82350411

Linux(CENTOS7) YUM方式安装mysql5.7

上一篇:利用阿里云的源yum方式安装Mongodb


下一篇:Centos7 Yum方式安装Mysql7