MySQL/phpMyAdmin Reset ROOT PASSWORD?

不想你离开。 提交于 2019-12-03 21:51:59

From Here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Stop mysqld and restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges. Because this is insecure, you might want to use --skip-grant-tables in conjunction with --skip-networking to prevent remote clients from connecting.

Connect to the mysqld server with this command:

shell> mysql

Issue the following statements in the mysql client. Replace the password with the password that you want to use.

mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
    ->                   WHERE User='root';
mysql> FLUSH PRIVILEGES;

The FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change

WINDOWS USERS

For me in wondows 8 this worked; First go to where you installed mysql, I was using wamserver and installed it under D:\Programs\wamp\bin\mysql\mysql5.6.12\bin so cd to that directory, then;

-> mysql UPDATE mysql.user SET Password=PASSWORD('xvpaic7q') -> WHERE User='root'

-> FLUSH PRIVILEGES
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!