Jonah Jonah - 7 months ago 59
MySQL Question

Added password to root, locked out of phpmyadmin

Using phpmyadmin, I changed the password for user root (both the localhost entry and the entry) from blank to "password". I was then locked out of phpmyadmin, getting the 1130 error: "Host ‘localhost’ is not allowed to connect to this MySQL server"

I did a bunch of searching on stackoverflow and found a solution that gets me back into phpmyadmin:

I simply add the line "skip-grant-tables" to the [mysqld] section of "my.ini".

But that seems like a bad solution, like I am just circumventing the problem rather than fixing it. I also tried another solution in which I add my username and password to "" in this section:

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'mypass';

but that has no effect. So my questions are:

  1. Why would adding a password to root lock me out of phpmyadmin in the first place? Shouldn't it just bring me to a login screen?

  2. What is the proper way to fix this?


  1. depending on the configuration you chose, it can lock you out completely.
  2. delete the configuration files and reupload the config wizard and create a new configuration.