I think that pandas is amazingly fast when dealing with PostGreSQL and sqlite3 so would expect the same with MySQL
There are a lot of tutorials available.
Here's a quick couple of script that both create and read an MySQL table.
https://pythontic.com/pandas/serialization/mysql
to find more, google: 'use pandas to work with MySQL databases'
Could you perhaps show a code sample? I'm reading more of a design question than a performance one, but it'd be useful to see what your code looks like before making suggestions.
see: LoadDatabase.py here:
https://python-forum.io/thread-33843.html
This is the method that I use.
This entire tutorials is about automatically creating a database directly from csv files and uses pandas to load the database.
Requires model which is also created within the tutorial by: BuildDbModel.py
(Feb-19-2022, 06:21 AM)ndc85430 Wrote: [ -> ]Could you perhaps show a code sample? I'm reading more of a design question than a performance one, but it'd be useful to see what your code looks like before making suggestions.
Quote:Actually I do this in every single .py file:
import mysql.connector
mydb = mysql.connector.connect(
host="SERVER IP"
port="SERVER PORT"
user="USER"
password="PASSWORD"
database="DB"
)