Error 1130 Hy000 Host
Contents |
Open-Source Projects Websites Presentations Why am I seeing "ERROR 1130 (HY000): Host ‘192.168.0.2' is not allowed to connect to this MySQL server"? Posted by Eric on 14 March 2014, 4:09 am When you connect to a MySQL server, it checks
Mysql Error 1130
it's grants table (the "user" table in the "mysql" database on the MySQL server) sqlstate hy000 1130 against the IP address of the connecting MySQL client machine. If there are NO MATCHING ENTRIES in the "host" column in the
Error 1045 (28000): Access Denied For User 'root'@ (using Password: Yes)
"user" table in the "mysql" database, mysqld will IMMEDIATELY CLOSE THE CONNECTION with ERROR 1130. For example, a client (192.168.0.2) tries to connect to it's MySQL server (192.168.0.100) and gets: [root@dbclient ~]# mysql -u jennifer --password=toughPassword host machine name is not allowed to connect to this mysql server -h 192.168.0.100 my_database ERROR 1130 (HY000): Host '192.168.0.2' is not allowed to connect to this MySQL server [root@dbclient ~]# ..a simple "telnet" TCP-connection test proves that the problem is not a firewall - the client is able to get to port 3306 (the MySQL port) on the database server: [root@dbclient ~]# telnet 192.168.0.100 3306 Trying 192.168.0.100... Connected to 192.168.0.100. Escape character is '^]'. GHost '192.168.0.2' is not allowed to connect to this MySQL host is not allowed to connect to this mysql server windows serverConnection closed by foreign host. [root@dbclient ~]# If we login to the MySQL server, and run "mysql", we can look at the grants table: [root@dbserver ~]# mysql mysql mysql> SELECT host,user FROM user; +-----------------+-----------+ | host | user | +-----------------+-----------+ | 192.168.0.6 | jennifer | | 192.168.0.7 | jennifer | | 127.0.0.1 | root | | ::1 | root | | localhost | jennifer | | localhost | root | +-----------------+-----------+ 11 rows in set (0.00 sec) mysql> We can see that "jennifer" *is* authorized to connect from several IP addresses, but not from the client IP 192.168.0.2. So we add the GRANT for access from THAT IP: mysql> GRANT ALL PRIVILEGES ON jennifer.* TO 'my_database'@'192.168.0.2' IDENTIFIED BY 'toughPassword'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) ..and voila: [root@dbclient ~]# mysql -u jennifer --password=toughPassword -h 192.168.0.100 my_database mysql> Share: These icons link to social bookmarking sites where readers can share and discover new web pages. Related posts: Why am I seeing "ERROR 1290 (HY000): The MySQL server is running with the -read-only option so it cannot execute this statement"? How do I create a new MySQL database for a user? How big is my MySQL database? Help! I forgot my MySQL root password! | TaggedMySQL |
a GitHub account Sign in Create a gist now Instantly share code, notes, and snippets. Star 0 Fork 0 koudaiii/gist:340527ca1e9042758aa5 Created Dec
Host Is Not Allowed To Connect To This Mysql Server Workbench
12, 2014 Embed What would you like to do? Embed Embed sqlstate[hy000] [1130] host '' is not allowed to connect to this mysql server this gist in your website. Embed Share Copy sharable URL for this gist. Share Clone via HTTPS Clone
Host 'localhost' Is Not Allowed To Connect To This Mysql Server
with Git or checkout with SVN using the repository's web address. HTTPS Learn more about clone URLs Download ZIP Code Revisions 1 ERROR 1130 (HY000): Host 'XXX.XXX.XXX.XXX' is http://www.ericshalov.com/2014/03/14/why-am-i-seeing-error-1130-hy000-host-is-not-allowed-to-connect-to-this-mysql-server/ not allowed to connect to this MySQL server Raw gistfile1.md ローカルマシンだとどうしても普段の開発で負荷がきつい時があって、 じゃあサーバーにアクセスするようにしてしまおうっとした際のメモ。 ERROR 1130 (HY000): Host 'XXX.XXX.XXX.XXX' is not allowed to connect to this MySQL serverの対処 allowしてあげる処理を入れてあげる $ mysql -u app -h 192.168.100.81 ERROR 1130 (HY000): Host '192.168.1.50' is not allowed to connect to this MySQL server remoteへログイン $ ssh app@192.168.100.81 # mysql -u root -p Enter https://gist.github.com/koudaiii/340527ca1e9042758aa5 password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 151637 Server version: 5.6.12 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select user , host from mysql.user; +------+------------------------+ | user | host | +------+------------------------+ | root | 127.0.0.1 | | root | ::1 | | root | test.example.jp | | root | localhost | +------+------------------------+ 4 rows in set (0.00 sec) mysql> grant all privileges on *.* to app@"192.168.1.50"; Query OK, 0 rows affected (0.01 sec) mysql> exit Bye もちろん許可されたuserとhostのみアクセスできる $ mysql -u root -h 192.168.100.81 -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'192.168.1.50' (using password: NO) $ mysql -u app -h 192.168.100.81 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the http://dba.stackexchange.com/questions/142935/windows-mysql-5-5-cannot-connect-to-localhost-error-1130-hy000-host-localho company Business Learn more about hiring developers or posting ads with us Database Administrators Questions http://faq.webyog.com/content/23/36/en/i-get-error-1130-host-is-not-allowed-to-connect-or-access-denied-or-could-not-connect-.html Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are is not voted up and rise to the top Windows MySQL 5.5 Cannot connect to localhost: ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server up vote 0 down vote favorite I can ping successfully from my Windows command line to localhost and to 127.0.0.1, but attempts to connect with mysql.exe fail... I found similar errors but their suggested solutions don't work/apply... http://stackoverflow.com/questions/19101243/error-1130-hy000-host-is-not-allowed-to-connect-to-this-mysql-server Host is not allowed to connect to MySQL is not allowed Host not Allowed Connectivity to MySQL Server I'm using a Windows 7 WAMP environment (an old Zend installation) meaning its all local (connections made from localhost/127.0.0.1). All worked fine last Friday when I did an import of a database, today, I get the cannot connect error. I did not overwrite mysql database (or at least, i am pretty sure I did not), so the error has taken me a little by surprise. C:\Backups\Daily\201607>ping /n 1 localhost Pinging Silver [::1] with 32 bytes of data: Reply from ::1: time<1ms Ping statistics for ::1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms C:\Backups\Daily\201607>ping /n 1 127.0.0.1 Pinging 127.0.0.1 with 32 bytes of data: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Ping statistics for 127.0.0.1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms C:\Backups\Daily\201607>mysql --user=root ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server C:\Backups\Daily\201607>mysql --user=root --host=localhost ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server My partial extract from my.ini file: [client] port=3306 # [mysqld] # The TCP/IP Port the MySQL Server will listen on
support and about this FAQ About the SQLyog program Connection issues How does SQLyog connect to MySQL? HTTP(s)-tunneling SSH-tunneling Connection problems Using the GUI Managing your MySQL Database Systems Database Schema Synchronization MySQL DATA synchronization SQL Scheduler and Reporting Tool Importing external data Backup/Restore SQLyog Job Agent (SJA) Working with Views, Stored Procedures and Triggers Character Set and Localization Issues MySQL bugs that affect SQLyog Questions on Open Source and Compiling Sitemap 9 users online | 9 Guests and 0 Registered Most popular FAQs I get error 1130 "Host is not allowed to ... (352491 views) Error no. 2003: Can't connect... (237593 views) SQLyog Version History (174573 views) Error no. 1045: "Connection denied..." (126328 views) Error No. 2005: Unknown MySQL server host... (100867 views) What is HTTP-tunneling? (88790 views) Can I use SQLyog with the WINE Windows emulator ... (81963 views) Error no. 1251: "Client does not support authentication..." (76991 views) What Is SSH and SSH-tunneling? (62222 views) The "DELIMITER" command does not have effect. Why is ... (56156 views) Latest FAQs SQLyog Version History (2014-06-08 10:22) I get error 1130 "Host is not allowed to ... (2014-01-30 12:21) About CHUNKs and BULKs (2014-01-09 11:53) SQLyog is a client for the MySQL server - ... (2013-08-04 04:48) Problems creating a functional DSN on 64 bit Windows. ... (2013-07-22 08:34) Sticky FAQs Connection issues » Connection problems ID #1024 I get error 1130 "Host is not allowed to connect ..." or "Access denied ..." or "Could not connect ..." Error 1130 is a networking error. The server cannot resolve the hostname of the client. Or the host is not allowed to connect to the MySQL server.There are basically 2 categories of possible reasons: * The simple one: In MySQL a user a user is specified using BOTH the user name and the host from where the user may connect. If no user has been created where the host-part (using wildcards or not) mathces the host of the client trying to connect MySQL will return this error. * Specific for MySQL 5.7: When upgrading to MySQL 5.7.3 from a previous version this may occur