Port 3306 error 2003

port 3306 error 2003

mysqldump: Got error: 2003: Can't connect to MySQL server on 3306 is the default Mysql port and so, the owners of the server keep on. I have 2 MySQL servers named esDB1 esDB2 and an isolative MaxScale server. All installed in CentOS 7 with installed information as. This tutorial will explain how to solve “ERROR 2003 (HY000): Can't get the same error, then determine the port (default is 3306) on.

youtube video

\

Port 3306 error 2003 - opinion

grep mysqld

where the option:

  1. – activates selection of all processes
  2. – enables full format listing
Check MySQL Process

If there is no output from the previous command, start the mysql service as follows:

$ sudo systemctl start mysql.service $ sudo systemctl start mariadb.service OR # sudo /etc/init.d/mysqld start

After starting mysql service, try to access the database server:

$ mysql -u username -p -h host_address

2. If you still get the same error, then determine the port (default is 3306) on which the mysql daemon is listening by running the netstat command.

$ netstat -lnp grep mysql

where the options:

  1. – displays listening ports
  2. – enables display of numerical addresses
  3. – shows PID and name of the program owning the socket
Find MySQL Port Number

Therefore use the option to specify the port you see from the output above while accessing the database server:

$ mysql -u username -p -h host_address -P port

3. If all the above commands run successfully, but you still see the error, open the mysql config file.

$ vi /etc/mysql/my.cnf OR $ vi /etc/mysql/mysql.conf.d/mysqld.cnf

Look for the line below and comment it out using the character:

bind-address = 127.0.0.1

Save the file and exit, afterwards restart the mysql service like so:

$ sudo systemctl start mysql.service $ sudo systemctl start mariadb.service OR # sudo /etc/init.d/mysqld start

However, if you have firewallD or Iptables running try to review firewall services and open the mysql port, assuming it is firewall blocking TCP-IP connections to your mysql server.

That’s all! Do you know other methods or have suggestions for solving the MySQL connection error above? Let us know by dropping a comment via the feedback form below.

Tags Linux FAQ's

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Related Posts

Sorry, no posts were found.