0514-86177077
9:00-17:00(工作日)
一. MySQL密碼的恢復(fù)方法之一 如果忘記了MySQL的root密碼,可以用以下方法重新設(shè)置: 1. KILL掉系統(tǒng)里的MySQL進(jìn)程; killall -TERM mysqld 2. 用以下命令啟動(dòng)MySQL,以不檢查權(quán)限的方式啟動(dòng); safe_mysqld --skip-grant-tables & 3. 然后用空密碼方式使用root用戶登錄 MySQL; mysql -u root 4. 修改root用戶的密碼; mysql> update mysql.user set password=PASSWORD('新密碼') where User='root'; mysql> flush privileges; mysql> quit 重新啟動(dòng)MySQL,就可以使用新密碼登錄了。
二. MySQL密碼的恢復(fù)方法二 有可能你的系統(tǒng)沒有 safe_mysqld 程序(比如我現(xiàn)在用的 ubuntu操作系統(tǒng), apt-get安裝的mysql) , 下面方法可以恢復(fù) 1. 停止mysqld; /etc/init.d/mysql stop (您可能有其它的方法,總之停止mysqld的運(yùn)行就可以了) 2. 用以下命令啟動(dòng)MySQL,以不檢查權(quán)限的方式啟動(dòng); mysqld --skip-grant-tables & 3. 然后用空密碼方式使用root用戶登錄 MySQL; mysql -u root 4. 修改root用戶的密碼; mysql> update mysql.user set password=PASSWORD('newpassword') where User='root'; mysql> flush privileges; mysql> quit 重新啟動(dòng)MySQL /etc/init.d/mysql restart 就可以使用新密碼 newpassword 登錄了。
標(biāo)簽:甘孜 和田 張掖 延安 江蘇 臨汾 淄博
上一篇:LINUX下ARP欺騙攻擊說(shuō)明與防范
下一篇:linux啟動(dòng)時(shí)掛載rootfs
Copyright ? 1999-2012 誠(chéng)信 合法 規(guī)范的巨人網(wǎng)絡(luò)通訊始建于2005年
蘇ICP備15040257號(hào)-8