# 1130 - The local Host is not allowed to connect to this MySQL server

I accidentally changed the "host" value for the root user inside the user table for mysql.

I need to change it to localhost because I changed it to arancillary2125 (another DNS name for other machines), but I cannot access mysql (from PHPMYADMIN or the command line) due to the fact that "localhost" no longer has permissions.

I am running Windows XP // apache //

I tried the following solutions, but they did not work:

https://serverfault.com/questions/92870/1130-host-localhost-is-not-allowed-to-connect-to-this-mysql-server

+4
source share
3 answers

Oops

This is on your local machine, I suppose? In Start-> Run, enter "services.msc" and find the MySQL service. Stop the service.

Edit:

Locate the my.ini file (usually in C: \ Windows or C: \ mysql, etc.). If you don’t have one, create one . This is a simple ASCII file.

Modify the file, add it to the [mysqld] section: skip-grant-tables .

At the command prompt, run net start MySQL and wait a minute. The MySQL service should start.

At the command prompt, run mysql -u root and press ENTER. You must log in to MySQL as the root user. Carefully modify your grants and log out. Stop the MySQL service / server. Re-edit the my.ini file and delete / comment out the line skip-grant-tables and restart the server. Try logging in again as root.

Just tested it in my Win XP Pro.

This essentially has the effect of traversing all the grant tables and thus does not require a search whether you should access it from this machine or not.

MySQL reference guide: - skip-grant-tables option

+14
source

Thus, I also had this problem that suddenly occurred C # 1130 - the local host is not allowed to connect to this MySQL server.

After searching and searching, I can tell you that the bdl solution is the way forward, as soon as you can return to the server, you can change the permissions and delete the skip-grant-tables lines in your my.ini mysql configuration file.

I would just support the bdl post, but I added too recently to the site to do this yet.

+5
source

Restore arancillary2125 (if even on the old countertop), and then gain access to your database this way.

+1
source

Source: https://habr.com/ru/post/1305593/


All Articles