3 回答

TA貢獻1757條經驗 獲得超8個贊
mysql-server
mysql-server
mysql-client
/var/run/mysqld/mysqld.sock
mysql-server
mysql-server
/etc/my.cnf/etc/mysql/my.cnf/var/lib/mysql/my.cnf
/etc/my.cnf
/tmp/mysql.sock
/etc/mysql/my.cnf
/var/run/mysqld/mysqld.sock
/etc/mysql/my.cnf
/etc/my.cnf

TA貢獻1824條經驗 獲得超6個贊
重置密碼
停,停止 mysql
sudo /etc/init.d/mysql stop
或其他發行版本: sudo /etc/init.d/mysqld stop
以安全模式啟動MySQL sudo mysqld_safe --skip-grant-tables &
使用root登錄MySQL mysql -uroot
選擇要使用的MySQL數據庫 use mysql;
重置密碼 update user set password=PASSWORD("mynewpassword") where User='root';
清除特權 flush privileges;
重新啟動服務器 quit
停止并再次啟動服務器 Ubuntu和Debian: sudo /etc/init.d/mysql stop...sudo /etc/init.d/mysql start
在CentOS、Fedora和RHEL上: sudo /etc/init.d/mysqld stop...sudo /etc/init.d/mysqld start
使用新密碼登錄 mysql -u root -p
鍵入新密碼,然后再次使用您的服務器,就像什么都沒有發生一樣。
update user set authentication_string=password('mynewpassword') where user='root';
添加回答
舉報