InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (10061 No connection could be made because the target machine actively refused it)

0 votes

Hi Guys,

I am trying to connect to MySql server from my Python code. But I am not able to connect. It is showing me the below error.

InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (10061 No connection could be made because the target machine actively refused it)

How can I solve this error?

Jul 15 in Python by akhtar
• 33,720 points
1,947 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to start your MySql server in your local system. Your Python connector is not able to connect with your MySql server. If you have your MySql server in the remote system, then specify the IP:3306.

answered Jul 15 by MD
• 79,930 points

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

Error:Can't connect to local MySQL server through socket '/tmp/mysql.sock

Hello @kartik, Try the code below: sudo /usr/local/mysql/support-files/mysql.server start ...READ MORE

answered Jun 24 in Python by Niroj
• 79,200 points
896 views
0 votes
3 answers

Python Selenium best tutorials for beginners

Hope this will help you...Python Tutorial READ MORE

answered Feb 11, 2019 in Python by aldrinjohn
• 140 points
2,224 views
0 votes
1 answer

how to solve the error : "ImportError: No module named Tkinter" in python.

Hi@Umama, If you are using Linux system, then ...READ MORE

answered Apr 27 in Python by MD
• 79,930 points
5,331 views