Questions tagged [pymysql]

0 votes
1 replies
Python3: Does a call to pymysql.rollback() require a commit?
I'm using python3.6 and pymysql 0.7.11. The call to rollback rolls a transaction back, according to the documentation. A call to commit finali...
asked 1 month ago
0 votes
1 replies
pymysql with multiprocessing throw typeerror
I used pymysql and multiprocessing. Please refer below code. import os from multiprocessing import Pool import pymysql class Test: def __...
0 votes
2 replies
I use pymysql to execute query in MySQL, but why the process is still alive after I close the connection?
I use pymysql to connect mysql and I set a read_timeout when connecting: conn = pymysql.connect(host=host,port=port,user=user,passwd=passwd,read...
asked 1 month ago
0 votes
2 replies
Facing below error “ModuleNotFoundError: No module named 'pymysql'”
Facing below error "ModuleNotFoundError: No module named 'pymysql'" import os import pymysql import pandas as pd host = os.getenv('MYSQL_HOST'...
asked 1 month ago
0 votes
2 replies
Update multiple columns on conflict postgres
I have to write a query to update a record if it exists else insert it. I am doing this update/insert into a postgres DB. I have looked into the...
0 votes
1 replies
Not importing pymysql but has “pymysql.err.OperationalError: (2003, ”Can't connect to MySQL server"
In flask, I planned to use MySQL, hence: from flaskext.mysql import MySQL However, when I ran the flask app, I have the below error: pymys...
asked 1 month ago
0 votes
1 replies
LOAD DATA LOCAL INFILE '/mnt/sample.txt' if empty?
It's been 2 weeks that I am trying to load data from text file into the SQL table usin gpython connector. I am able to load data successfuly with...
asked 1 month ago
0 votes
0 replies
virtualenv python PyMySQL ErrorNo 99
I downloaded PyMySQL and trying to use it in virtualenv by tying this code. conn = pymysql.connect(host='localhost', user='root', passwd='123',...
asked 2 months ago
0 votes
0 replies
load data in sql table if table exists but it is empty
I am writing a python script which connects to the SQL database. It creates databases based on the folder paths and tables based on the files pre...
asked 2 months ago
0 votes
0 replies
Problem connecting MariaDB using PyMysql in Python
I have a Flask Python API that connects with a MariaDB database in a Docker container and I'm connecting to the database with PyMysql. The probl...
asked 2 months ago
0 votes
1 replies
Database Connection Function for Python
I have written a function for connecting to a database using pymysql. Here is my code: def SQLreadrep(sql): connection=pymysql.connect(hos...
asked 2 months ago
0 votes
0 replies
How to multithread a session?
I am trying to multithread my python script, which works with mysql via sqlalchemy with "threading" module from threading import Thread But mu...
asked 2 months ago
-1 votes
0 replies
Baffling Flask / MySQL not updating issue
I have a Flask app running that involves, amongst other things, incorporating weather data from an API into running machine learning predictions....
asked 2 months ago
0 votes
0 replies
gevent.exceptions.BlockingSwitchOutError InvalidSwitchError
I'm write a tcp server, which use gevent to handler client data, and use sqlalchemy+pymysql to deal with database mysql. There may thousands of c...
asked 2 months ago
1 votes
2 replies
Pandas read_sql() - AttributeError: 'Engine' object has no attribute 'cursor'
I am trying to read data from MySQL query using pandas read_sql() method with python3+sqlalchemy+pymysql I tried to follow the following tutoria...
asked 3 months ago
0 votes
0 replies
Need query to ALTER more rows in one column without WHERE constrain
I am looking for a query which I can use in pymysql to UPDATE the rows in one column without the WHERE constraint. This is the query I used but...
asked 2 months ago
0 votes
1 replies
Why the cursor is not created again?
I've got this code that only returns data the first time the loop is executed. The other times, despite there are data in the database and the qu...
asked 3 months ago
3 votes
0 replies
PyMySql: SELECT MAX(timestamp) results in “Incorrect datetime value: '0000-00-00 00:00:00'”
I am running a MySQL 5.7 server with two tables: Table_A id name ......... 1 foo 2 bar Table_B id parent_id name created...
asked 3 months ago
0 votes
1 replies
Check if a database connection is busy using python
I want to create a Database class which can create cursors on demand. It must be possible to use the cursors in parallel (two or more cursor can...
0 votes
0 replies
why PyMySQL closed so early when using contextmanager and sqlalchemy?
I used python 3's contextmanager to manage MySQL connection's close(), for simplicity, I wrote a simple example: from sqlalchemy import create_...
asked 3 months ago
0 votes
1 replies
pymysql query : unable to rollback
The connection is fine, but the query sentence seems problematic. query1 = """SELECT * FROM `DATABASE` WHERE `coin` = 'LTC'""" query2 = """SELEC...
asked 3 months ago
0 votes
1 replies
pymysql.err.InterfaceError: (0, '') error when doing a lot of pushes to sql table
I am doing a lot of inserts to a mysql table in a short period of time from python code (using pymysql) that uses a lot of different threads. Ea...
asked 3 months ago
0 votes
1 replies
PyMySQL callproc() not executing statements in proc
I'm trying to call MySQL proc using python pymysql lib but for some reason it's not working. My procedure takes 2 args, if I pass the arguments w...
asked 2 months ago
-2 votes
1 replies
How are the keys defined in pymysql if we use DictCursor?
I was looking for a way to better represent the output we get after running a query on a mysql table via pymysql and stumbled upon DictCursor. I...
asked 2 months ago
0 votes
1 replies
How can I input code stored in a MySQL cell into my Python beautifulsoup
I'm parsing through many different websites and want to keep their unique tags in a MySQL table and use that stored code to retrieve new content...
asked 4 months ago