Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2024-07-19 19:04:04
Original
689 people have browsed it

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
Copy after login

My Solution

Make sure your IP have access to database server

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

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';
Copy after login

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'@'%';
Copy after login

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

FLUSH PRIVILEGES;
Copy after login

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!

source:dev.to
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!