Ways to fix “mysqldump error 2003”

Ways to fix “mysqldump error 2003”

Server owners will often use mysqldump for taking database backup completely. While using this tool, you may get some errors.

This error states that the connection has been refused by the network. Below is the statement of how you will get the error message:
Code:
mysqldump: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) when trying to connect
mysql-error.jpg

Downtime of Mysql service:

If the server doesn't help to run the Mysql then of course you will get the error. Even if you reboot the server, it won’t listen to your technical terms. Whenever you try to restore or back up the database, you will get the error mysqldump error 2003.

Use the below command to check the MySQL is running on the server or not:
Code:
ps aux | grep mysql
Just kill the dead process of mysql and try to fix the problem by restarting the service. You can even do some configurations in MySQL service to ensure the safety process from index files, data file corruption, DDoS attack, traffic, and outrages.

Custom port MySQL run:

3306 is the default Mysql port and so, the owners of the server keep on trying to increase the security then and there with the help of a custom port. To do some operations in the database, you need to enroll the Mysql port number without fail.

There are some situations where Mysql looks out for a custom port first and then takes the default port number.

Find out the port number by using the netstat command like below:
Code:
netstat -lnp | grep mysql
Once you find the Mysql port number kindly use it with the mysqldump command:
Code:
mysqldump -u root -p password -P customport databasename > backup.sql
Socket issue in Mysql:

There will be frequent exchanges between the client and the server. They keep on exchanging data and requests in terms of pseudo files. If the pseudo-file haven’t been given proper permission or its absence may end up with the error.

Check the socket file is present in /tmp/mysql.sock. If you mistakenly delete the files it may lead to the socket issue problem.

You can create a new socket file in mysql.sock or else try to access mysqladmin. Once you create the socket file, kindly restart it again.

Only root users or owners have permission to remove the files from /tmp directory. There are many cases, which we try to change the socket of the Mysql location.
Giver proper privilege to the socket file for accessing it without interruption.
Author
kumkumsharma
Views
5,538
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top