All Questions
72 questions
0
votes
0
answers
65
views
How to lock database for SELECT query?
I've a python script that uses SQL Database. I've to process folder sequentially so I've created a 2 column, first one will tell if particular folder is processed or not & second one if it's being ...
1
vote
2
answers
156
views
optimize insert operation in MySQL (InnoDB)
I have this table:
create table tab3(
id int not null auto_increment,
phrase text,
link_1 int,
link_2 ...
2
votes
1
answer
67
views
Is calling a database class on app creation correct for pooling?
Start
doadmin.Database().__init__()
Class
class Database(object):
connection = None
cursor = None
def get_c(self):
return self.cursor
def __init__(self):
if Database.connection is None:
...
0
votes
2
answers
50
views
Question about multi fields index in MySQL
I'm having an doubt about coumpound indexes in my application. My db engine is Mysql 8.0 with INNODB and my question is the following:
My application has a model called Report with the follwing fields ...
3
votes
1
answer
464
views
MySQL database copy
I need to create a copy of the database in my MySQL Server using a Python program.
After a little research, I found mysqldump as the better approach:
import subprocess
command_to_copy_db = f"...
-1
votes
1
answer
2k
views
mysql.connector.errors.ProgrammingError: 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides
I am working on a python project with MySQL connectivity. I have MySQL as a shell, i.e.,I need to use mysqlsh command in the Terminal to use MySQL(I am using MacOS Mojave 10.14.6). I needed to use a ...
0
votes
1
answer
157
views
Airflow to BigQueryt data load taking forever
Im currently working as a junior data engineer. My main job right now is to move data from a DB in MYSQL (which gets updated every few minutes via webhooks) and send it to BigQuery as frequently as ...
-1
votes
1
answer
595
views
Mysql takes longer when using php or python compared to worbench queries
Versions:
MySQL Community Server: 8.0.16 in Windows server (Configuration file: unknow)
Workbench: 8.0
Problem:
When I make a query through workbench, it takes 1 second but when I make a query through ...
-2
votes
2
answers
13
views
4 Rows in to 2 two with similar column attributes
I have this table:
Pincode1
Pincode2
City
32417
0
Hyd
67812
0
Ban
0
72407
Hyd
0
77113
Ban
I want result like this table:
Pincode1
Pincode2
City
32417
72407
Hyd
67812
77113
Ban
How can I do it? Can ...
0
votes
0
answers
109
views
Is this database correctly structured?
I am in the process of converting a bus timetable to a database structure. I am building a free mobile app for a specific itinerary in my country that will:
let users know when their next bus is due ...
1
vote
2
answers
4k
views
What is the proper way to handle multithreading insert
I'm a newbie on Database and for now I need to work with MySQL to build a web server.
In a word, I have a web framework, developed with Python. It will read/write data from/into MySQL.
For now I don't ...
0
votes
1
answer
940
views
MySQL table with a lot of text
So I have this database (Size 3.1Gb total), but this is due to one specific table I've got, containing A LOT of console output text, from some test runs. The table itself is 2.7Gb, and I was wondering ...
0
votes
2
answers
651
views
Error reading data from MySQL table 1227 (42000): Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
I am connected to the MySQL database in Python using the (MySQL Connector) Python module in jupyter notebook. I can perform operations for example creating a table or reading data from a table. In the ...
0
votes
0
answers
192
views
Python / AWS RDS - 300 insert statements taking 10 minutes to complete
I'm using Python 3.7 with SQLAlchemy on Ubuntu 18.04. I have two MySQL Databases - a local instance hosted on bare metal and an Amazon RDS instance. Both are accessible from MySQL Workbench on my ...
-1
votes
2
answers
196
views
How to make transactions atomic in Mysql 5.6
How do we make the following transactions atomic?
conn - is a connection to the old primary, which is being reset as replica now.
Python code
conn.execute('unlock tables')
conn.cursor().execute('stop ...