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;
相關文章
相關標籤/搜索