mysql> set global validate_password.policy=0; # 设置策略
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password.length=1; # 设置长度
Query OK, 0 rows affected (0.00 sec)
mysql> create user 'xiaokang'@'%' identified by '123456'; # 创建新用户
Query OK, 0 rows affected (0.11 sec)
mysql> flush privileges; # 刷新权限
Query OK, 0 rows affected (0.11 sec)
新建完用户后通过SQLlog远程链接报错
Error No.1251 Client does not support authentication protocol requested by server;consider upgrading Mysql client
然后通过查询按照下面操作在链接就可以
mysql> ALTER USER 'xiaokang'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.02 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.09 sec)