Home > Database > Mysql Tutorial > body text

mysql忘记了root的密码(linux下解决方法,window同理)_MySQL

WBOY
Release: 2016-06-01 12:59:33
Original
962 people have browsed it

mysql 忘记了root的密码的时候的解决步骤,

1: cd /etc/mysql/(进入mysql的配置目录)

2:vim my.cnf \skip-grant-tables(进入mysql的配置文件,在配置文件中加入跳过“授权表”的命令)

3:/etc/init.d/apache restart(重启mysql就可以了)

4:命令行输入mysql(直接进入数据库)

5:然后进入mysql->user->(update user set Passwrod=PASSWORD("123456") where User="root")

6:然后把skip-grant-tables注释掉

Related labels:
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