MySQL/phpMyAdmin Reset ROOT PASSWORD?

孤人 提交于 2019-12-05 07:50:21

问题


I'm having MySQL on RHEL, and phpMyAdmin interface also. I have normal MySQL user access which i remember but i forget the root password.

  • How to SAFELY reset the MySQL root password? (I have root account on O/S)

回答1:


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




回答2:


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


来源:https://stackoverflow.com/questions/14703223/mysql-phpmyadmin-reset-root-password

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