sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
- 在这个配置文件中的[mysqld]这一块中加入
skip-grant-tables
这句话,重启服务 mysql -u root -p
直接回车免密登录use mysql
update user set authentication_string=password("yourpassword"),plugin='mysql_native_password' where user='root';
- 删除skip-grant-tables这句话,重启服务
mysql5.7重置密码
猜你喜欢
转载自blog.csdn.net/qq_29630271/article/details/89846538
今日推荐
周排行