In this tutorial we’ll begin our discussion on using python to interact with MySql databases. We’ll download and install the MySql connector for python and …
Original source
In this tutorial we’ll begin our discussion on using python to interact with MySql databases. We’ll download and install the MySql connector for python and …
Original source
21 responses to “Python Programming Tutorial – 48: Install MySql Connector for Python”
talk too much… please don't talk!!
sir what would be the procedure if we dont use the localhost ,what changes can be done in setting up the sqlworkbench?? kindly help !!
I'm in python 3.6 but when I download 3.4 v MySql it's saying can't find 3.4 python
change title to Python 2.X
Thank u!! it Works
does wampserver mysql works on it
Hi! I am using python 2.7 and I installed the SQL connector for the same. But when I run the command
conn=mysql.connector.connect(user='root',password='varun',host='localhost')
I am getting the following error message. could you please help me!?
Error: Can't connect to MySQL server on 'localhost:3306' (10061 No connection could be made because the target machine actively refused it)
I'm on Windows 10 (x64), python 3.5, here you can download mysql client http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
Worked for me: mysqlclient-1.3.7-cp35-cp35m-win32.whl
what should I do next if I found this error when I try to import mysql.connector?
>>> import mysql.connector
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import mysql.connector
ImportError: No module named mysql.connector
can anyone helps why it doesnt work and install properly on mac?
hi, i have installed mysql connector but i can only import mysql.connector for python 2.7 which comes with mac, though i have python3.5, but in python3.5 i get an error ImportError: no module named 'mysql'… please suggest for python3.5… many thanks
i am using python 3.5..the mysql connector for python 3.5 hasn't been released yet..what should i do now??
thanks, really helpful !!!
thanks! you are the best friend!
Thank you. Very useful video.
Great video. Thanks!
"python v3.4 not found".. what should to do to make it find it. I downloaded python3.4 exactly where it is expected
how and where to create the table? the one you named as test.
when i try to connect m getting the following errors
>>> conn=mysql.connector.connect(user='root',password='',host='localhost')
Traceback (most recent call last):
File "C:Python34libsite-packagesmysqlconnectornetwork.py", line 467, in open_connection
self.sock.connect(sockaddr)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#24>", line 1, in <module>
conn=mysql.connector.connect(user='root',password='',host='localhost')
File "C:Python34libsite-packagesmysqlconnector__init__.py", line 159, in connect
return MySQLConnection(*args, **kwargs)
File "C:Python34libsite-packagesmysqlconnectorconnection.py", line 129, in _init_
self.connect(**kwargs)
File "C:Python34libsite-packagesmysqlconnectorconnection.py", line 454, in connect
self._open_connection()
File "C:Python34libsite-packagesmysqlconnectorconnection.py", line 417, in _open_connection
self._socket.open_connection()
File "C:Python34libsite-packagesmysqlconnectornetwork.py", line 470, in open_connection
errno=2003, values=(self.get_address(), _strioerror(err)))
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (10061 No connection could be made because the target machine actively refused it)
will it work for 3.4 ?
Thank you for your helpful tutorial. I am wondering if mysql connector works the same as mysqlDB. Could you help me through that?