python管理mysql(一)

本文提供MySQLdb模块的下载与安装指南,适用于Python 2.4至2.7版本,同时介绍了Python 3环境下使用PyMySQL连接MySQL的方法。包括详细步骤和注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、MySQLdb模块下载安装

下载地址:

http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/

安装:

  $ tar xfz MySQL-python-1.2.1.tar.gz
  $ cd MySQL-python-1.2.1
  $ # edit site.cfg if necessary
  $ python setup.py build
  $ sudo python setup.py install # or su first

  

官网:

MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 will be supported in a future release. 

这个是不支持python3的

 

2、python3 要连接mysql可以使用PyMySQL

pip install PyMySQL

 

转载于:https://www.cnblogs.com/huanhuanang/p/4936673.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值