一、使用Docker部署本地MySQL数据库
bash
docker run --restart=always -p 3307:3306 --name mysql -e MYSOL_ROOT_PASSWORD=lms123456 -d mysql:8.0.25
参数解析:
用户名:root
密码:lms123456
端口:3307
二、在Pycharm开发工具中配置连接MySQL数据库


三、安装zdppy_mysql
bash
pip install zdppy_mysql
四、创建数据库
python
from mysql.db_object import Database
db = Database(port=3307, password="lms123456")
db.add_database_force("test_01")