All Questions
18,068
questions
0
votes
0
answers
27
views
Python script gets stuck due to mysql query running for longer period
Mysql version - 5.7
Python version - 3.9.2
I have a dynamic mysql query, which sometimes runs for over 10 mins or something and the mysql's set timeout has been set to around 1 minute. Which is why i ...
0
votes
0
answers
38
views
How to Use a Single INSERT INTO Statement for Multiple Rows in Python?
I’m currently working on a Discord Python bot where I loop through a list of ForumTags and generate an INSERT INTO SQL statement for each object to insert data into a MySQL database.
However, I want ...
0
votes
0
answers
17
views
Flask-MySQL Python long request
I'm using Flask to create an API. I need to make a query to the database and for this I used the flask_mysqldb library
The fact is that before that I used another library (mysql.connector) and my ...
0
votes
1
answer
38
views
Unable to make a remote api call to flask app(for MySQL connection) inside my apache server
I have an apache server running on Alma Linux. I have the flask code setup to accept API calls from remote connections. So my API call hits the flask which then connects to MySQL database.
When I try ...
0
votes
1
answer
51
views
Error while insert row in sql table using SQLAlchemy
I am trying to read the below code from .sql file in python using SQLAlchemy and execute it. I am able to create the table but while inserting the row, I am getting error:
ProgrammingError: (pymysql....
-1
votes
1
answer
76k
views
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'XXX.XXX.XXX.XXX' (timed out)") [closed]
I'm using docker compose and Flask python.
I'm trying to run an old application but I get sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '...
0
votes
0
answers
39
views
How to return the same value using for loop and mysql query in Python
I have a code with some variables and I need to find the same data from my mysql database.
from typing import Generator
from requests_html import HTMLSession
import pandas as pd
import numpy as np
...
0
votes
0
answers
16
views
Delay problem in python/mysql integration
I'm making a python interface that has a user registration and login part using Mysql. I made a class to register and another to perform the login which worked normally, then I tried to apply ...
0
votes
0
answers
35
views
SQLAlchemy - MySQL database connection timeouts
I am having a webapp with python as backend. In this webapp, I need a connection to my MySQL database, which I establish by using SQLAlchemy. The problem is that whenever I start my application on the ...
0
votes
1
answer
36
views
SQLAlchemy delete Method: Valid Strategies for synchronize_session in Bulk Deletion
I'm working on a FastAPI project where I need to perform a bulk deletion of jobs using SQLAlchemy. The list of job IDs to be deleted is provided via a POST request from Postman. However, I'm ...
-1
votes
0
answers
10
views
trouble installing mysqlclient [duplicate]
so i just followed a couple of procedures leading towards install mysqlclient which are:
$ sudo apt-get install python3-dev
$ sudo apt-get install libmysqlclient-dev
$ sudo apt-get ...
-2
votes
0
answers
39
views
How to determine how much data is sent to the database using SQL and Python
I'm inserting an image file like my.png into a database (table with a column settings of blob) but I want to display the amount of data sent like live update.
Example
import threading
import pymysql
...
0
votes
2
answers
46
views
Slow sqlalchemy ".in_" clause
I'm trying to execute the following query using sqlalchemy:
query = session.query(
func.count(ExampleTable.id)
).filter(ExampleTable.environment == self.environment))
if ...
0
votes
0
answers
23
views
How to loop through multiple tables to send to GCS?
I currently have a task where I need to move my external tables into GCS. For that, I'm using the MySQLToGCSOperator to move my external tables and schema to GCS; things like tables, columns, PKs, FKs....
0
votes
0
answers
31
views
MySQL Error 1452 but parent table exists and data types are the same
Here's the total error:
pymysql.err.IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`ncbi`.`chromosomes`, CONSTRAINT `chromosomes_ibfk_1` FOREIGN KEY (`...