1、安装mysql源

下载地址:http://dev.mysql.com/downloads/repo/yum/

下载之后用yum安装:yum localinstall -y xx.noarch.rpm

2、安装mysql

yum install -y mysql-community-server

3、启动

service mysqld start 

启动之后用 grep "passowrd" /var/log/mysqld.log获得密码

 

问题:

用mysqladmin修改密码出现错误

Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.

mysqladmin: unable to change password; error: 'Your password does not satisfy the current policy requirements'

这是因为MySQL对设置密码强度有要求导致的。

解决:

先登录mysql,然后设置密码强度
set global validate_password_policy=0; //表示设置为安全最低,但密码长度依旧最少8位

 


set global validate_password_length=4; //将密码长度设为4位

 

然后就可以执行修改密码了。

 

 

 

 

 

 

 

相关文章:

  • 2021-05-18
  • 2022-12-23
  • 2021-07-02
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2021-12-09
  • 2021-10-27
  • 2021-05-24
  • 2021-06-27
  • 2022-01-14
相关资源
相似解决方案