Questions tagged [mysql-python]

Use this tag for questions about the MySQL-Python database connector library (MySQLdb). Do not use this tag for questions about MySQL Connector/Python (use the [mysql-connector-python] tag instead).

MySQL-Python, also known as MySQLdb, is a database connector library that implements the Python Database API.

This tag should be used to identify questions related to:

  • Installing the MySQL-Python library;
  • Using the library to connect to a MySQL database from a Python interpreter or script;
  • Specific implementation details of the library; e.g., thread safety, error messages, cursor behavior.

This tag should not be confused with:

The MySQL-Python project is hosted on Sourceforge; however, as of September 2014, a newer package than the one found on Sourceforge (v1.2.4b4) is available from the Python Package Index (v1.2.5).

Andy Dustman (user profile on stackoverflow) has written a detailed User's Guide and maintains a code repository for the project on github.

3186 questions
0
votes
0 answers

Django disable database ssl using python-alpine docker image

I'm trying to create a Django app using docker. Because of some problem, I want to connect with database without using ssl/tls. When I use local environment, or docker image ubuntu, it work fine when I adding these code under DATABASES in…
0
votes
0 answers

SyntaxError: source code string cannot contain null bytes

I am trying to run python manage.py makemigrations and the below exception is being thrown. please note that - 1 - I have my own User class in models.py 2 - Two model classes, one inside the app and other file outside the app. Outside models.py was…
Eswar
  • 25
  • 1
  • 9
0
votes
0 answers

Trying to connect to remote db with python, error user denied from IP, however Workbench from my IP works just fine

Im working on creating a python file meant to update tables in a database from a csv. The machine and the IP I am working from have access to the remote DB I am trying to connect to, but I keep recieving Error while connecting to MySQL: 1045…
0
votes
0 answers

Error: Packet sequence number wrong for read replica

We have an environment with the following libraries and versions; Python 3.8 Flask 1.0.2 Flask-SQLAlchemy 2.3.0 SQLAlchemy 1.2.10 PyMySQL 1.0.2 Normally, we run on a single RDS Mysql but because of the high load we needed to add a read replica and…
xxlali
  • 996
  • 2
  • 15
  • 43
0
votes
1 answer

Which versions of google-cloud-pubsub and mysql-connector-python are compatible?

I'm setting up a project that will utilize both a MySQL DB and Google PubSub and it will be hosted in GCP. I'm working on the dependencies and I ran into an error when installing both…
0
votes
1 answer

Connection Pool blocking threads

I have a class that subclasses a Thread, and I'm having trouble creating objects with mySQL connections inside it asynchronously. Each MyObject has a mysql connection pool that is created on __init__. I'm running into an issue where creating…
0
votes
0 answers

pyinstaller exe "mysql.connector.errors.NotSupportedError: Authentication plugin 'mysql_native_password' is not supported"

I am connecting to sql database with python. My code works fine in console, but when i convert it to exe with pyinstaller i get this error. error pyinstaller code: python -m PyInstaller --noconsole --onefile --icon=icon.ico --name=Gkod main.py from…
0
votes
0 answers

Reading from a serial port - database only getting data to first column

I reading data from a serial port and trying to print the data onto the database, whenever I try and print the data to my DB it is only printing the data to the first column instead of being spread out. READ_DATA def read_data(self): if…
2Thingz
  • 1
  • 2
0
votes
0 answers

Create Constraint only if not exists MySQL v5.7.12

I want to create constraint in my table ONLY if it not exists. Is there any way to do it in MySQL? Below is the sample query which will return rows if constraint exists, want to execute ADD Constraint if not returning any rows. How can I possibly do…
sanju
  • 7
  • 2
0
votes
0 answers

Python MySQL Connector: 'caching_sha2_password' authentication plugin not supported

That is the exact error: Traceback (most recent call last): File "D:\Programming projects\Project.py", line 3, in db = mysql.connector.connect( File "C:\Users\BboyM\venv\lib\site-packages\mysql\connector\__init__.py", line 179, in…
0
votes
0 answers

MySQl Connector; TypeError: an integer is required (got type str)

I am trying to connect to mysql in python using jupyter notebook. Here is the code for the connection (password excluded for obvious reasons): vg = mysql.connector.connect( port = 3306, user = 'root', passwd = '****', database =…
0
votes
0 answers

How to fix 'ModuleNotFoundError: No module named 'mysql'' error in Python file when debugging?

ModuleNotFoundError: No module named 'mysql' when debug Python file I've run in "Run Code" mode in VS Code and it work properly. But any time I switch to "Run Python file" or "Debug Python file", it always appear and stop in import row import…
0
votes
0 answers

How to avoid pyMysql callprocedure error?

I try to write all sql sytax/queries on python as on the work bench, but I can't run cursor.callproc(). my code : sqq.py result : check the manual that corresponds to your MySQL server version for the right syntax to use near 'get()' at line 1
fond bcn
  • 15
  • 3
0
votes
0 answers

Unable to connect to mysql via mysql.connector when in docker

mysql.connector returns "mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (111 Connection refused)" when making request to local mysql with python/flask file in docker container I have a python file…
0
votes
0 answers

How to connect withPython MySQL without error?

How to choose the right parameters on Python mysql.connector ? No matter what I try, it just won't connect (the pc name ,user name ...). ...(10061 No connection could be made because the target machine actively refused it)
fond bcn
  • 15
  • 3
1 2 3
99
100