mysql數據庫忘記root密碼如何處理
1.關閉mysql數據庫:service mysql stop
2.找到etc/my.cnf 文件
在mysqld下面增加:
skip-grant-tables
skip-name-resolve
3.啓動mysql數據庫:service mysql start
4.無密碼登錄數據庫: mysql -- 回車
6.更改密碼:
use mysql;
update user set authentication_string=PASSWORD("newpass") where user="root";
exit;
7.設置成功 ,重新改回my.cnf
希望對你有所幫助