MySQLdb安装
2015-09-25 11:04
591 查看
1、下载MySQLdb安装包:
wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=nchc
2、解压
tar -zxvf MySQL-python-1.2.3c1.tar.gz
3、更改配置
cd MySQL-python-1.2.3c1
whereis mysql_config 获取位置,一般位于/usr/bin/mysql_config
vim site.cfg
更改:mysql_config = /usr/bin/mysql_config
更改:threadsafe = True
4、测试
Python
import MySQLdb
有可能报:site-packages/pkg_resources.py:1031: UserWarning: /home/***/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment
variable).
修改方式给.python-eggs加权限:chmod g-wx,o-wx .python-eggs/
然后继续测试:import MySQLdb
如果无报错则安装成功
wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=nchc
2、解压
tar -zxvf MySQL-python-1.2.3c1.tar.gz
3、更改配置
cd MySQL-python-1.2.3c1
whereis mysql_config 获取位置,一般位于/usr/bin/mysql_config
vim site.cfg
更改:mysql_config = /usr/bin/mysql_config
更改:threadsafe = True
4、测试
Python
import MySQLdb
有可能报:site-packages/pkg_resources.py:1031: UserWarning: /home/***/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment
variable).
修改方式给.python-eggs加权限:chmod g-wx,o-wx .python-eggs/
然后继续测试:import MySQLdb
如果无报错则安装成功
相关文章推荐
- MySQL的btree索引和hash索引的区别
- mysqldump之不老将
- MySQL Count()函数
- 同机安装多个MySQL版本-MySQL 5.7源码安装流程详解
- C#连接MySql
- MySQL AVG()函数
- mysql优化建议
- Code First for MySql命令操作
- mysql的group by应用
- MySql 安装
- 【手把手教】主从MySql配置
- ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
- lnmp下如何关闭Mysql日志保护磁盘空间
- mysql执行sql语句优化分析命令explain命令小记
- mysql授权
- MySQL 查询优化器
- seafile4.3.1 + windows 2012 server +mysql 部署记录(1)
- seafile4.3.1 + windows 2012 server +mysql 部署记录(2)
- seafile4.3.1 + windows 2012 server +mysql 部署记录(3)
- MySQL中的索引初步介绍