更新时间:2023-02-04 09:57:47
尝试一下:
mysql -u root -h 127.0.0.1 -p
Enter password: (enter the random password here)
参考: https://dev.mysql.com/doc /refman/5.7/en/data-directory-initialization-mysqld.html
在此之后,您可以使用
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';
Following this, you may reset your password using
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';