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

MySQL 5.7之后,刚初始化的MySQL实例要求先修改密码。否则会报错:

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

所以修改下密码就OK:

alter user root@localhost identified by 'P@ssword1!';
flush privileges;

posted on 2024-09-15 10:58  阿陶学长  阅读(8)  评论(0编辑  收藏  举报