在/ect/my.cnf中添加如下:
skip-grant-tables
sudo mysqld restart
mysql回车,进入到sql
>user mysql;
>update user set authentication_string=password(‘123qwe‘) where user=‘root‘ and Host = ‘localhost‘;
搞定;
删掉skip-grant-tables;
sudo mysqld restart
完事;
时间: 2024-12-25 06:34:15