This project is designed to batch modify the character set of tables and table fields in a MySQL database. The project is written in Python and uses the aiomysql
library for asynchronous database operations.
config.py
: Configuration file containing database connection settings.main.py
: Main program file containing the primary logic for character set modification.async_db.py
: Asynchronous database operation class, encapsulating common database operation methods.
Before running the project, ensure the following dependencies are installed:
pip install aiomysql
Python version 3.7 or higher is required.
-
Configure the database connection information in
config.py
. -
Execute the following command:
python main.py
The program will output the results of the character set modification operations.
2024-07-29 03:03:27 INFO main.py:70 Table:xxx_table1_name start modify charset 2024-07-29 03:03:27 INFO main.py:70 Table:xxx_table2_name start modify charset 2024-07-29 03:03:27 INFO main.py:70 Table:xxx_table3_name start modify charset 2024-07-29 03:03:27 INFO main.py:70 Table:xxx_table4_name start modify charset 2024-07-29 03:03:27 INFO main.py:70 Table:xxx_table5_name start modify charset ...