在/etc/my.conf文件中[mysqld] 下面最后增加一行:skip-grant-tables
記住是[mysqld]下最后,不要增加到[mysqld_safe
]下面
保存之后,重啟Mysql,在linux命令行直接執行:mysql回車
OK
修改密碼:
update mysql.user set password=password('root') where user='root'
結果報錯:
mysql> select host,user,password from user ;
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
desc user;
查看字段發現沒有password字段,有authentication_string
字段
update mysql.user set authentication_string=password('root') where user='root' ;
ok
刪除/etc/my.conf文件中[mysqld] 下面的skip-grant-tables
重啟mysql
總結
以上所述是小編給大家介紹的Mysql5.7.14 linux版密碼忘記完美解決辦法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網站的支持!
您可能感興趣的文章:- linux創建用戶useradd命令代碼示例
- linux 中的ls命令參數詳解及ls命令的使用實例
- Linux常用命令last的使用方法詳解
- Linux中 sed 和 awk的用法詳解
- Linux下Tomcat8.0.44配置使用Apr的方法
- linux下多個mysql5.7.19(tar.gz)安裝圖文教程
- linux下mysql5.7.19(tar.gz)安裝圖文教程
- Linux 中firewall的使用方法總結