Home >Database >Mysql Tutorial >mysql忘记密码的解决方法

mysql忘记密码的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 18:00:311048browse

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
->
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn