如果 MySQL 正在運行,首先殺之: killall -TERM mysqld。 ?
啟動 MySQL :/usr/bin/safe_mysqld --skip-grant-tables & ?就可以不需要密碼就進入 MySQL 了。 ?
然后就是 ?>use mysql ?>update user set password=password("new_pass") where user="root"; ?>flush privileges; ?重新殺 MySQL ,用正常方法啟動 MySQL 。
Redhat的safe_mysqld在/usr/bin下,而使用tarball缺省安裝在/usr/local/bin下。
啟動 MySQL :/usr/bin/safe_mysqld --skip-grant-tables & ?就可以不需要密碼就進入 MySQL 了。 ?
然后就是 ?>use mysql ?>update user set password=password("new_pass") where user="root"; ?>flush privileges; ?重新殺 MySQL ,用正常方法啟動 MySQL 。
Redhat的safe_mysqld在/usr/bin下,而使用tarball缺省安裝在/usr/local/bin下。