啓動mysql:
/etc/init.d/mysqld start
root用戶數據庫密碼丟失:
1、殺掉所有的mysql相關的進程
2、/etc/my.cnf 文件中添加skip-grant-tables
3、/etc/init.d/mysqld start --skip-grant-tables 啓動mysql服務時跳過權限表
4.mysql -u root 不需要密碼直接登錄數據庫
5.通過update的方式改密碼:
update mysql.user set password=password("root1234") where user="root";
6. FLUSH PRIVILEGES;
7.去除文件中添加的skip-grant-tables