8.0无法设置root用户 Variable 'validate_password.length' is a GLOBAL

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
ERROR 1410 (42000): You are not allowed to create a user with GRANT

 

解决办法  以下是 8.0版本的错误信息

 

ERROR 1410 (42000): You are not allowed to create a user with GRANT
mysql> validate_password.length = 6
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'validate_password.length = 6' at line 1
mysql> set validate_password.length = 6
-> ;
ERROR 1229 (HY000): Variable 'validate_password.length' is a GLOBAL variable and should be set with SET GLOBAL

 

# 设置密码短一点


mysql> set global validate_password.length = 6
-> ;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password.policy = LOW
-> ;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
ERROR 1410 (42000): You are not allowed to create a user with GRANT

 

创建个新的用户 


mysql> CREATE USER 'admin'@'%' IDENTIFIED BY 'MyNewPass4!';
Query OK, 0 rows affected (0.02 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%';
Query OK, 0 rows affected (0.03 sec)

 

 

然后使用admin进行远程登录的账户

 

posted @   不会游泳的鱼丶  阅读(117)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示