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进行远程登录的账户
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了