Local Error 1130 problem solution
When connecting to mysql database, ERROR 1130 (HY000) occurs: the Host ‘XXXX’ is not allowed to connect to this mysql Server. Local localhost will not work either. If you reinstall mysql database, you will be afraid that the original database cannot be restored.
Appear this kind of problem may be caused by illegal power off and remove the root user, mysql database user without root, in the table if localhost is also unable to log in, you need to. In my ini finally add skip – grant – tables, so you don’t need a password login, after landing in the following SQL statement to create the root user (I am using version 5.1, different versions can be different SQL statements)
INSERT INTO `user` VALUES ('localhost', 'root', 'your password', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0', '0');
After success, delete ski-grant-tables in my.ini, and you can now log in using the root password locally.
Remember in the database installed mysql, do not illegally shut down, forced power off, otherwise this problem will occur.
If Error 1130 appears locally, then the remote connection must also appear. If the local connection problem is solved, the remote connection problem may not be solved.
Error 1130 appears in the remote connection
There are two ways to solve this problem
1. Table modification
Maybe your account doesn’t allow you to log in remotely, only at localhost. At this time, as long as the computer at localhost, after logging into mysql, change the “host” item in the “User” table in the “mysql” database, and change the name from “localhost” to “%”.
mysql -u root -pvmware
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user
2. Authorization law
For example, if you want myUser to use MyPassword to connect to a mysql server from any host.
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
If you want to allow user MyUser to connect to the mysql server from a host with IP of 192.168.1.3, use myPassword as the password
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
Supplement: Reinstalling mysql database is not a successful solution
Sometimes you have to reinstall the mysql database, but the installation is always unsuccessful due to the impact of the previous installation of mysql files. You can completely remove the mysql legacy files in the following two steps
1. Full text search MySQL and delete by looking up registry Regedit.
2. Delete MySQL data, generally in the MySQL directory under C: \ProgramData (it is recommended to backup this folder before deleting, so as to restore the data in the future).
Read More:
- MySQL local connection Error 1130_ The solution of MySQL 1130 error report when remote connection through Navicat for MySQL
- Host is not allowed to connect to this MySQL server
- Solution of MySQL data garbled problem
- After installing MySQL again under Linux, the solution of ‘MySQL module failed to start’ appears
- Module not found error: the solution to the problem of no module named ‘MySQL’
- Sqlog connect to MySQL 8.0.24 remote server, error: 2058 solution
- MySQL Workbench: Error Code: 2013. Lost connection to MySQL server during query solution
- Remote connection MySQL error 1045 solution
- MySQL: if the remote connection using navicatip fails, prompt “is not allowed to connect to this MySQL server”
- Node connects to MySQL error “Er”_ NOT_ SUPPORTED_ AUTH_ Mode “solution
- Solve the problem of MySQL 1251 client does not support
- mysql problem solving: mysqladmin: connect to server at’localhost’ failed
- How to solve the problem of “08001” when JDBC connects to MySQL
- MySQL error — multiple methods of failed to find valid data directory and MySQL setting password appear
- Golang MySQL error SQL: unknown driver “MySQL” (Forgotten import?) solution
- Solve the problem that node. js USES MySQL to connect econnunion 127.0.0.0.1:3306
- Solve the problem that dbvisualizer cannot connect to mysql8
- MySQL installation failed: dpkg: error processing package MySQL server (- – configure): dependency problem
- MySQL startup problem (ERROR 1045 (28000): Access denied for user’ODBC’@’localhost’ (using password: NO))
- Linux-mysql8.0 password reset problem – error 1396 (HY000): Operation alter user failed for ‘root’ @’localhost ‘