测试版本为8.0.20
使用grant隐式创建用户:
mysql> grant select on sys.* to ‘dblight’@‘127.0.0.1’ identified by ‘123’;
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 ‘identified by ‘1234’’ at line 1
发现报错,去掉identified by关键字:
mysql> grant select on sys.* to ‘dblight’@‘127.0.0.1’;
ERROR 1410 (42000): You are not allowed to create a user with GRANT
结合报错信息,得出结论:8.0开始已经取消了grant隐身创建用户的功能,所以需要采用先创建再授权的方式:
mysql> create user ‘perf’@‘127.0.0.1’ identified by ‘123’;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
发现8.0默认有密码策略&#x