Home > Database > Mysql Tutorial > body text

linux mysql root 密码忘记重置_MySQL

WBOY
Release: 2016-06-01 13:09:50
Original
826 people have browsed it

1.    停止mysql服务 /etc/init.d/mysql stop
2.    在终端输入 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables  --user=root 此时mysql以跳过检测的模式运行

3.    打开另一个终端 

       输入 mysql -uroot 进入mysql ,

       mysql> update mysql.user set Password=PASSWORD('密码') where user = 'root';
       mysql> FLUSH PRIVILEGES;
4.    退出mysql

5.    启动mysql服务    /etc/init.d/mysql start

完成。

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!