'how to move from sqllite database to mysql database?

i want to move from SQLite database M, MySQL database. if i understood correctly, so i can do it with changing the engine:

engine = create_engine('sqlite:///foo.db', echo = False) 

to:

engine = create_engine('mysql://username:password@localhost/ db_name (the database name) ')


Solution 1:[1]

engine = create_engine("mysql+pymysql://user:pass@some_mariadb/dbname?charset=utf8mb4")

or

engine = create_engine("mariadb+pymysql://user:pass@some_mariadb/dbname?charset=utf8mb4")

sqlalchemy-mysql

pip install MySQL-python

On Ubuntu based systems:

apt-get install python-mysqldb

On RHEL/CentOS based systems:

yum install MySQL-python

On Windows: Unofficial Windows Binaries for Python Extension Packages

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1