Troubleshooting of MySQL errors: Difference between revisions

Jump to navigation Jump to search
Line 385: Line 385:
INSERT IGNORE INTO `target`.`table` SELECT * FROM `source`.`table` LIMIT 0, 10000;
INSERT IGNORE INTO `target`.`table` SELECT * FROM `source`.`table` LIMIT 0, 10000;
</pre>
</pre>
=== ERROR 2003 (HY000): Can't connect to MySQL server on 'ip' ===
'''ERROR 2003 (HY000): Can't connect to MySQL server on 'IP' '''
Solution:
* Check if the IP is alive
'''ERROR 2003 (HY000): Can't connect to MySQL server on 'IP' (111 "Connection refused")'''
Solution:
* Check if the MySQL service is running or not<ref>[https://www.cyberciti.biz/faq/how-to-find-out-if-mysql-is-running-on-linux/ HowTo: Find out If MySQL Is Running On Linux Or Not]</ref>. If not, start the MySQL service.
* Check the firewall rules
'''ERROR 2003 (HY000): Can't connect to MySQL server on 'IP' (116 "Connection timed out")'''
Solution:
* Check the configuration of MySQL
** comment out [https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_bind-address bind-address] = 127.0.0.1 or set to *
** comment out [https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_skip-networking skip-networking]
* Check the permission of MySQL database user.
* Check the firewall rules at (1) your personal computer (2) the server where MySQL service located (3) ISP/VM providers. More on [https://devops.profitbricks.com/tutorials/install-mysql-on-centos-7/#firewall-rules Install MySQL on CentOS 7 | ProfitBricks DevOps Central]
** Check if your IP address was included in the allowed IP address list of firewall rules.
** Check if your IP address was changed by using [https://whatismyipaddress.com/ What Is My IP Address?] services.
* (optional) Monitor the firewall activity. More on [https://www.howtogeek.com/220204/how-to-track-firewall-activity-with-the-windows-firewall-log/ How to Track Firewall Activity with the Windows Firewall Log] on {{Win}}
References:
* [https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/ Connect to a MySQL database remotely]
* [http://wiki.navicat.com/wiki/index.php/Error_2003 Error 2003 - Navicat Wiki]
* [http://faq.webyog.com/content/23/15/en/error-no-2003-can_t-connect.html SQLyog MySQL Admin FAQ - Error no. 2003: Can't connect...]


== Resource and Environmental Errors ==
== Resource and Environmental Errors ==

Navigation menu