lbien
lbien

Reputation: 13

How to restore mysql users

I dropped accidentally all the users exist in my mysql DB and when I refresh the admin page I had this error :

Error

MySQL said:

1130 - Host 'localhost' is not allowed to connect to this MySQL server phpMyAdmin tried to connect to the MySQL server, and the

server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

How can I restore those users without losing my data ?

Upvotes: 1

Views: 424

Answers (1)

dpw
dpw

Reputation: 1586

You just need to set an init file with the correct SQL to create/set a password for the root user, and then restart the server with the --init-file parameter.

Follow the directions here. Any SQL in the init file will be run, so you can create more users if you need to also.

Upvotes: 1

Related Questions