Home  >  Article  >  Database  >  ERROR HY): Host &#.# is not allowed to connect to this MySQL server

ERROR HY): Host &#.# is not allowed to connect to this MySQL server

WBOY
WBOYOriginal
2024-07-19 19:04:04688browse

ERROR HY): Host

My Problem

I want to connect to mysql server using my personal computer but I have this error.

ERROR 1130 (HY000): Host '123.32.23.12' is not allowed to connect to this MySQL server

My Solution

Make sure your IP have access to database server

SELECT host FROM mysql.user WHERE User = 'root';

If you only see results with localhost and 127.0.0.1, you cannot connect from an external source. If you see other IP addresses, but not the one you're connecting from - that's also an indication.

You will need to add the IP address of each system that you want to grant access to, and then grant privileges:

CREATE USER 'root'@'ip_address' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'ip_address';

If you see %, well then, there's another problem altogether as that is "any remote source". If however you do want any/all systems to connect via root, use the % wildcard to grant access:

CREATE USER 'root'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

Finally, reload the permissions, and you should be able to have remote access:

FLUSH PRIVILEGES;

Reference

  • https://stackoverflow.com/questions/19101243/error-1130-hy000-host-is-not-allowed-to-connect-to-this-mysql-server

The above is the detailed content of ERROR HY): Host &#.# is not allowed to connect to this MySQL server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn