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).
- 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
- MYSQL login error: mysqladmin: connect to server at’localhost’ failed
- MySQL error — multiple methods of failed to find valid data directory and MySQL setting password appear
- Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: no)
- Sorting out MySQL “too many connections” solutions
- Solve MySQL error 1698 (28000): access denied for user ‘root’ @’localhost ‘
- node.js Server MySQL database connection timeout (error: connect etimeout)
- Error 1364 (HY000): field ‘SSL_ cipher’ doesn’t have a default value
- Connection between PHP 7.4 and MySQL (MariaDB) under Ubuntu (kali Linux)
- MySQL skip grant tables add user error 1290
- MySQL startup problem (ERROR 1045 (28000): Access denied for user’ODBC’@’localhost’ (using password: NO))
- MySQL password setting error message: error 1054 (42s22): unknown column ‘password’ in ‘field list’
- MySQL ERROR 1054 (42S22): Unknown column’password’ in’field list’ error
- 2059 error in connecting to database by Navicat premium
- Can’t connect to MySQL server error 111
- ERROR 1148 (42000): The used command is not allowed with this MySQL version
- Node connects to MySQL error “Er”_ NOT_ SUPPORTED_ AUTH_ Mode “solution
- Error 1045 (28000): solution to access denied for user ‘root’ @’localhost ‘(using password: no)
- Solution to error 1045 in mysqldump