Centos为一般用户安装MySQLdb
来源:互联网 发布:咫尺网络小程序 编辑:程序博客网 时间:2024/05/18 04:00
环境与背景
OS: CentOS 6.6
Python: 2.6.6
Pip: 7.1.0 (Pip安装请参考https://pip.pypa.io/en/stable/installing.html)
安装过程
pip install MySQL-python --user
一条命令即可解决,--user
选项是为当前用户,也是普通用户安装MySQLdb.
安装问题点
缺少python-dev的包:
错误表现为,pymemcompat.h:10:20: error: Python.h: No such file or directory
解决方法为,yum install python-devel
缺少MySQL的开发包:
错误表现为,_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory
_mysql.c:39:26: error: mysqld_error.h: No such file or directory
_mysql.c:40:20: error: errmsg.h: No such file or directory
解决方法为,yum install mysql-devel
成功验证
输入命令:
python -c 'import MySQLdb'
如果没有任何输出,表示MySQLdb已安装完成.
参考
安装MySQL易错点
0 0
- Centos为一般用户安装MySQLdb
- centos 安装setuptools、mysqldb
- Centos安装MySQLdb记录
- CentOS下安装MySQLdb
- centos 安装MySQLdb
- centos系统下为python安装MySQLdb库
- CentOS 6.5中如何由一般用户切换为root用户
- CentOS中由一般用户切换为root用户
- centos 5.5中如何由一般用户切换为root用户
- CentOS中由一般用户切换为root用户
- CentOS中由一般用户切换为root用户
- CentOS中由一般用户切换为root用户
- CentOS下安装python-mysqldb
- CentOS下python-mysqldb安装
- Centos下安装python mysqldb
- CentOS 安装python MySQLdb模块
- CentOS下安装python-mysqldb
- CentOS下安装python-mysqldb
- Different Ways to Add Parentheses
- Android手机壁纸(静态)
- 单调队列及优化DP poj2823/poj1821/poj2373
- wm命令使用方法及LCD显示图标大小不正常时解决办法
- Android实现activity状态保存
- Centos为一般用户安装MySQLdb
- Install Docker Mac OS X
- mysql Access denied for user root@localhost错误解决方法总结(转)
- 【Android杂谈】万能的ListView的使用
- SVM如何解决多分类问题
- 基于Spring + Spring MVC + Mybatis 高性能web构建
- item属性总结
- 常见 Java 字节码 指令 助记符
- 通过设备指针调用其他驱动程序(同步方式)