mysql忘记密码

来源:互联网 发布:嵌入式linux应用开发 编辑:程序博客网 时间:2024/05/17 01:37

1.进入mysql的bin目录

e:cd E:\mysql-5.6.36-winx64\bin

或者将

E:\mysql-5.6.36-winx64\bin

加入环境变量Path

2.使用root账户

mysql -uroot -proot

3.不知启动服务是否有影响
启动::net start mysql停止::net stop mysql

4.遇到错误

mysql -uroot -proot

Warning: Using a password on the command line interface can be insecure.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
则试试

mysql -uroot

5.建立用户

CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456'; 
如果遇到错误

The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

flush privileges
然后再创建用户








原创粉丝点击