You must reset your password using ALTER USER statement before executing this statement.

MySQL 5.7以后,刚初始化的MySQL实例要求先修改密码。不然会报错:mysql

mysql> create database test;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

因此修改下密码就OK:sql

alter user root@localhost identified by 'P@ssword1!';
flush privileges;
相关文章
相关标签/搜索