# 数据库连接测试工具 ## 环境要求 - Python 3.8.3 或更高版本 - 支持 Windows 和 Linux (CentOS 7.9) 系统 ## 快速开始 ### Windows 环境 1. 安装依赖: ```bash pip install -r requirements.txt ``` 2. 运行测试: ```bash python test_db_connection.py ``` ### CentOS 7.9 环境 详细部署说明请参考 [README_CENTOS.md](README_CENTOS.md) 快速部署(使用脚本): ```bash chmod +x deploy_centos.sh ./deploy_centos.sh ``` 或手动安装: ```bash python3 -m pip install -r requirements.txt --user python3 test_db_connection.py ``` ## 数据库配置 - 主机: 127.0.0.1 - 端口: 3306 - 用户名: prod - 密码: hmdmxjIvfIjIoflL ## 说明 脚本会尝试连接MySQL数据库,如果连接成功会显示: - MySQL版本 - 当前数据库名称 - 连接ID 如果连接失败,会显示详细的错误信息,方便排查问题。