mysql Connector problems in python

Asked

Viewed 35 times

0

I’m having trouble connecting to mysql.connector.. In php myadmin, connects normal, and also bash is entering normal in mysql.. Only python gives this problem..

mydb=mysql.connector.connect(host='localhost',database='disc',user='root',password='12345678', use_unicode=True, charset='utf8')

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/mysql/connector/__init__.py", line 179, in connect
return MySQLConnection(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/mysql/connector/connection.py", line 95, in __init__
self.connect(**kwargs)
File "/usr/lib64/python2.7/site-packages/mysql/connector/abstracts.py", line 716, in connect
self._open_connection()
File "/usr/lib64/python2.7/site-packages/mysql/connector/connection.py", line 206, in _open_connection
self._socket.open_connection()
File "/usr/lib64/python2.7/site-packages/mysql/connector/network.py", line 512, in open_connection
errno=2003, values=(self.get_address(), _strioerror(err)))

Does anyone know what it can be?

  • what version of your python?

  • version 2.7 ....

  • consider using the latest version of python since python2.7 will no longer be supported later this year

  • I have tried to readapt my code to python3 but found many problems : ( I will use python2.7 while giving

  • more detail about the implementation you used and also the error

  • Look, from what I’ve analyzed so far the problem seems to be in mysql, for some reason it doesn’t want to connect via tcp

  • I was told that it may be that phpmyadmin connects via socket, and python connects via tcp, so it is not connecting

  • I was able to solve, just uncomment the line in the mysql service script, the line SKIP="-Skip-networking" it is enabled by default in Slackware : ( I didn’t know that

  • Very good, mark your answer as resolved to finalize your question ;)

Show 4 more comments

1 answer

1


Solved, it was problem in the service of Slackware, which comes by default the line SKIP="-Skip-networking" was enough to uncomment it which worked

Browser other questions tagged

You are not signed in. Login or sign up in order to post.