Newsletter Subscription | Glossary | Contact Us
Sample data
Home > All Categories > MySQL > Errors > Can't connect to MySQL server on 'localhost' (10061)
Question Title Can't connect to MySQL server on 'localhost' (10061)
Authored by:
Viewed: 3479 times so far
When I try to connect a database, I get the following message: "Can't connect to MySQL server on 'localhost' (10061)",What it can be happening ?



This message is generated by MySQL Database server for many reasons by :

SOLUTION

1. MySQL Database Server (mysqld) is not running. Check your operating system's process list to ensure the mysqld process is present.

2. The port number might be different in your setup.

3. You are running on a system that uses MIT-pthreads. If you are running on a system that doesn't have native threads, mysqld uses the MIT-pthreads package.

4. You are using Linux and one server thread has died (dumped core). In this case, you must kill the other mysqld threads (for example, with kill or with the mysql_zap script) before you can restart the MySQL server.

5. The server or client program might not have the proper access privileges for the directory that holds the Unix socket file or the socket file itself.

SOLUTION

1. Check whether the server is running on that host by executing telnet some_host 3306 and pressing the Enter key a couple of times. (3306 is the default MySQL port number. Change the value if your server is listening to a different port.) If there is a MySQL server running and listening to the port, you should get a response that includes the server's version number. If you get an error such as telnet: Unable to connect to remote host: Connection refused, then there is no server running on the given port.

2. If the server is running on the local host, try using mysqladmin -h localhost variables to connect using the Unix socket file. Verify the TCP/IP port number that the server is configured to listen.

3. Make sure that your mysqld server was not started with the --skip-networking option. If it was, you will not be able to connect to it using TCP/IP.

4. Check to make sure that there is no firewall blocking access to MySQL. Applications such as ZoneAlarm and the Windows XP personal firewall may need to be configured to allow external access to a MySQL server.

Click Here to View all the questions in Errors category.
File Attachments File Attachments
There are no attachment file(s) related to this question.
User Comments User Comments
User Comment sami_ciit@hotmail.com on Wed, Jul 2nd, 2008 at 2:51 AM
i am facing this problem when i try to connect datea bast and i m using port 8081 while my date base is running in internet explorer 2013 Lost connection to MySQL server during query Socket error on read. WSAGetLastError return 10060($274C)
Post Comment Add a Comment
Email Address:
Comment/Message
Verify Code

Post Comment How helpful was this article to you?
Related Questions Related Article
  1. Top five of the most common MySQL database connection errors
  2. Regarding MySQL connectivity - Access denied message
  3. Dangerous command
Article Information Additional Information
Article Number: 42
Created: 2008-01-15 6:35 AM
Rating No Rating
 
Article Options Article Options
Print Question Print this Question/Article
Email Question Email this Question/Article to Friend
Export to MS Word Export to MS Word
Bookmark Article
del.icio.us Bookmark del.icio.us Bookmark
Digg It Digg It
Furl It Furl It
Subscribe to Article Subscribe to Article
 
Language Translation Language Translation
 
Search Knowledge Base Search Knowledge Base