There are many ways to check your MySQL database connection. One of them is checking using Telnet. In this article, you’ll learn what Telnet is, and how to run tests to check your MySQL database is connected to the server.
What Is a Telnet
Telnet is a network protocol that you can use to directly connect to the server and check the service availability. If after confirming the credentials you're still having issues accessing a MySQL database, you can use Telnet to further test the connection. It's possible that the MySQL service is not running on the server at the moment but you should be able to confirm this by following these simple steps.
Please note that on newer versions of Windows, Telnet is not enabled automatically. You can turn on Telnet in your computer's Control Panel by clicking on Programs and Features, then clicking on Turn Windows features on or off and ticking the box next to Telnet.
Below are the instructions to run a test with Telnet.
|With a Windows machine, go to Start > Run > cmd. With Mac, you will need to open your Terminal application.
Once in the command-line interface, you need to type the command telnet mydomain.com 3306 (be sure to replace mydomain.com with your own domain name).
|Hit the Enter key to activate the command. It will connect to the server using Telnet and test the port. If it is running, you will get a confirmation string beginning with the MySQL database version number.
|If the MySQL service is not running, you will receive an error "Could not open a connection to the host..".
If you receive a connection failed error, the likely causes are either a temporary high load on the server, or the service is being restarted. This should clear up within minutes. If you’re still getting the error, please contact us for further assistance.