Heim >Datenbank >MySQL-Tutorial >mysql忘记密码的解决方法

mysql忘记密码的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 18:00:311045Durchsuche

mySQL忘記管理密碼的解決方法 ! 如果mySQL正在運作,請先關閉,

關閉方法:
service mysqld stop

killall -TERM mysqld

接下來,重新開啟mySQL,請額外加上指令:
/usr/bin/safe_mysqld --skip-grant-tables &
(請注意執行程式的路徑,請替換成你的程式路徑)

然后启动mySQL,在命令模式下键入:mysql
# mysql (這個也是,如果直接執行找不到程式,請打完整路徑)
>use mysql
>update user set password=password("新密碼") where user="root";
>flush privileges;
>exit;

關閉現在執行的mySQL,重新正常啟動mySQL。

启动mysql命令:
mysql -h localhost -uroot -p
password
->
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn