Cara mengatasi cant connect to mysql server on localhost 10061 windows 10

i have install the "mysql-6.0.11-alpha-win32" setup in windows 7 . then try to connect to the mysql but it takes long time to connect to the mysql server then show the error message like

--------------------------- 
SQLyog - Free MySQL GUI 
--------------------------- 
Error No. 2003 
Can't connect to MySQL server on 'localhost' (10060) 
--------------------------- 
OK Help 
--------------------------- 

any one have idea about this error no. 2003 then help me.... thanks in advance... .

asked Nov 14, 2011 at 6:39

This is the firewall issue and you need to update the firewall present in the system. Normally Microsoft windows firewall restricts the system to access the permission of the server and it doesn’t allow connecting the server. Then for solving this kind of issue normally we need to update this firewall. The updated version of the firewall will provide this facility to connect the MYSQL Server to the system. Then you can able to run SQL on your system.

answered Nov 14, 2011 at 6:45

Cara mengatasi cant connect to mysql server on localhost 10061 windows 10

3

Add mysqlid.exe into your windows firewall settings to access your server remotely.

user9517

114k20 gold badges206 silver badges289 bronze badges

answered Jan 2, 2013 at 13:19

Update the windows hosts file. Make sure that your windows host file has following line

// if not, add at the end
// location: c://windows/system32/drivers/etc.host.file (open with notepad)
// (# xxxxxx is comment and hence do not start with it)

127.0.0.1 localhost

chicks

3,64910 gold badges26 silver badges36 bronze badges

answered Dec 22, 2016 at 22:49

I can’t access my MySQL database remotely, it’s throwing “cannot connect to mysql server (10060)” error. Please help.

That was a recent support ticket received at our Server Management Services department where we manage our customer servers.

Website owners usually face this error due to firewall restrictions, MySQL service downtime, and more.

Today, we’ll discuss the top 5 reasons for this error and how our Server Administrators fix them.

“Cannot connect to mysql server (10060)” error – Causes and Fixes

Customers usually receive this error when they try to access the MySQL server remotely.

“Cannot connect to mysql server (10060)” error means that the connection established failed because the host connected has failed to respond in time.

Let’s now see the main reasons for this error and how our Server Experts fix them.

1) Service downtime

One of the common reasons for this error is MySQL service not running on the server. And, the reason for service downtime can be due to heavy traffic spikes, resource outages, DDoS attacks, and more.

How we fix?

So, our Support Engineers confirm whether the MySQL service is running in the server with the netstat command.

netstat -plan | grep :3306

If the service fails or doesn’t respond, we’ll kill the dead process and restart the service once again. In addition to that, we check the server logs to find the reason for the downtime and fix it permanently.

[Do you face intermittent MySQL downtime issues? Our experienced Server Administrators can fix this for you.]

2) MySQL configuration issues

By default, MySQL listens for connections only from localhost.

bind-address 127.0.0.1

So, if MySQL only supports local connections, users will receive “Cannot connect to mysql server (10060)” error when establishing a remote MySQL connection.

How we fix?

Firstly, our MySQL experts check the MySQL configuration file /etc/mysql/my.cnf and confirm that MySQL remote access is enabled.

If not, we change the value of bind-address to 0.0.0.0 in /etc/mysql/my.cnf to accept all connections.

bind-address 0.0.0.0

Alternatively, we comment the bind-address parameter to enable remote connections. Similarly, in some cases, we give the bind-address as the IP address of the server where MySQL service listens.

bind-address database-IP

Here, MySQL will only listen connections to the server’s IP. Most importantly, we restart the MySQL service to reflect the changes.

We always recommend taking the backup of this file before making any modifications. Because, a small typo error in this file can break your MySQL service.

[Do you want to enable Remote MySQL access on your server? Click here, one of our Server Admins can do this for you.]

3) Firewall restrictions

The next possible cause is MySQL port 3306 not opened in the server firewall. In other words, MySQL server can’t accept any connection from the outside world due to firewall.

How we fix?

In such cases, our Support Engineers temporarily disable the firewall to determine whether the firewall is the culprit. Later, we check the MySQL port from /etc/mysql/my.cnf and use the telnet command to check the external connectivity to MySQL port.

telnet xx.xx.xx.xx 3306

If any firewall rules interfere with connectivity, we set the firewall rules to allow connections on the MySQL port.

For example, if MySQL server runs on Windows, we whitelist the MySQL port from Start > Control Panel > System & Security > Windows Firewall > Exceptions > Add Port.

Similarly, in Ubuntu servers we open the MySQL port in UFW firewall using the below command.

ufw allow 3306

4) No privileges to the remote user

Similarly, this error can occur if the MySQL user doesn’t have enough privileges to remotely access the MySQL server.

In such cases, users will get an error “cannot connect to mysql server (10060)”.

How we fix?

Here, our Hosting Engineers grant the user proper privileges to remotely access the database. Most importantly, we whitelist the remote hostname or IP address.

GRANT ALL ON *.* to 'user'@'host_name' identified by 'Password';
FLUSH PRIVILEGES;

Because, if a user connects as root user from a different machine, MySQL server can easily identify whether it’s the root user in the local server or remote server.

For example in cPanel servers, we whitelist the remote host or IP address from cPanel > Databases > Remote MySQL .

[Worried about MySQL user permissions. One of our MySQL Experts can help you here.]

5) Wrong MySQL connection string

Last but not least, wrong connection string used to access the MySQL server remotely may lead to this error. A small typo in the MySQL server name, database name, username, port, etc. can block the connection to the MySQL server.

How we fix?

In such cases, our Support Experts get the MySQL connection string details from the client. After that, we configure an ODBC connection to the server. If that works, we compare the new string with the connection string. And, if any mismatch is noted, we’ll correct it immediately.

Conclusion

In short, error “cannot connect to mysql server (10060)” can happen due to firewall restrictions, MySQL configuration issues, MySQL service downtime, and more. Today, we’ve discussed the top 5 reasons for this error and how our Support Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";