MySQL缺失mysql_config文件
打算爬虫,安装mysqldb 结果使用pip安装出错
在centos-6.4上pip install mysql-python,报错如下[sentry@kjtest111 mysql-python]$ pip install mysql-python
Downloading/unpacking mysql-python
Running setup.py egg_info for package mysql-python
sh: /usr/bin/mysql_config: No such file or directory
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-sentry/mysql-python/setup.py", line 18, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: /usr/bin/mysql_config not found
Complete output from command python setup.py egg_info:
sh: /usr/bin/mysql_config: No such file or directory
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-sentry/mysql-python/setup.py", line 18, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
工作环境:centOS6.4
解决方法:1. 通过报错信息看出是缺少mysql_config,在/usr/bin/下面应该有的mysql_config文件没有,网上的解决方案都是apt-get install libmysqlclient-dev,但是apt-get是Debian、Ubuntu系列的网络安装命令,yum是Redhat、Centos、Fedora是网络安装命令,接着发现Centos上应该安装mysql-devel
2. yum install mysql-devel,发现有冲突,报错如下:
--> Running transaction check
---> Package mysql-devel.x86_64 0:5.1.69-1.el6_4 will be installed
--> Processing Dependency: mysql = 5.1.69-1.el6_4 for package: mysql-devel-5.1.69-1.el6_4.x86_64
--> Running transaction check
---> Package mysql.x86_64 0:5.1.69-1.el6_4 will be installed
--> Processing Conflict: MySQL-client-5.5.30-1.el6.x86_64 conflicts mysql
--> Processing Conflict: MySQL-server-5.5.30-1.el6.x86_64 conflicts mysql
--> Processing Conflict: mysql-5.1.69-1.el6_4.x86_64 conflicts MySQL
--> Finished Dependency Resolution
Error: mysql conflicts with MySQL-devel-5.5.30-1.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
3. 使用 rpm -qa|grep mysql查看mysql的安装情况
mysql-devel-5.5.16-1.el6_4.x86_64
mysql-client-5.5.16-1.el6_4.x86_64
mysql-server-5.5.16-1.el6_4.x86_64
4. 使用rpm -e mysql-devel-5.5.16-1.el6_4.x86_64移除已有的安装包
5. 再次使用yum install mysql-devel 发现和mysql-server, mysql-client的版本有冲突
6. 去网上寻找相同的版本下载http://downloads.skysql.com/archive/index/p/mysql/v/5.5.16,下载64bit的rpm文件,使用rpm -ivh MySQL-devel-5.5.16-1.linux2.6.x86_64.rpm安装
7. 安装成功后,去/usr/bin/目录下,发现生成了mysql_config文件,继续pip install mysql-python,顺利完成。
MySQL缺失mysql_config文件的更多相关文章
- Linux下MySQL的数据文件存放位置
http://bbs.csdn.net/topics/390620630mysql> show variables like '%dir%';+------------------------- ...
- Linux下MySQL的数据文件存放在哪里的
mysql> show variables like '%dir%';+-----------------------------------------+------------------- ...
- Linux下MySQL的数据文件存放在哪里的??
http://bbs.csdn.net/topics/390620630 mysql> show variables like '%dir%';+------------------------ ...
- MySQL frm+ibd文件还原data的办法【数据恢复】
MySQL frm+ibd文件还原data的办法[数据恢复] 此方法只适合innodb_file_per_table = 1 当误删除ibdata 该怎么办? 如下步骤即可恢复: 1 ...
- mysql 有关的文件
1.在linux上安装好mysql之后,存在很多mysql有关的文件. 2./etc/rc.d/init.d/mysql 是mysql服务的启动脚本,是对mysqld_safe的封装,mysqld_s ...
- mysql 的日志文件
mysql的日志文件 日志文件大致分为 error log, binary log, query log, slow query log, innodb redo log ;如图: 1.error ...
- mysql 的数据文件
mysql的数据文件 由于mysql的数据文件结构主要跟mysql的存储引擎相关,这里不做过多解释,具体查看各个引擎章节的内容 .首先上一段小辉老师的教程; 在MySQL 中每一个数据库都会在定义好( ...
- [转载]mysql慢日志文件分析处理
原文地址:mysql慢日志文件分析处理作者:maxyicha mysql有一个功能就是可以log下来运行的比较慢的sql语句,默认是没有这个log的,为了开启这个功能,要修改my.cnf或者在mysq ...
- mysql.cnf 配制文件详解
代码如下: [client]port = 3306socket = /tmp/mysql.sock [mysqld]port = 3306socket = /tmp/mysql.sock basedi ...
随机推荐
- MAC OS上Nginx安装
admin@admindeMac:local]$ brew install nginx ==> Installing dependencies for nginx: pcre, openssl ...
- js函数声明
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- iOS开发,应用间的跳转
预习:URL由两部分组成-- 1.scheme:协议头(http:// ftp:// 等等) 2.path:路径(URL中path可以没有) 一.简单实现跳转到指定APP(也就是说跳转到的APP必须 ...
- iOS开发小技巧--实现将图片保存到本地相册
一.报错的代码 错误 -- out of bounds 超出界限的意思 *** Terminating app due to uncaught exception 'NSInvalidArgument ...
- UIView的autoresizingMask和autoresizesSubviews属性的剖析
UIVIew的autoresizingMask和autoresizesSubviews属性的剖析 autoresizingMask是为了iPad开发中横竖屏适配而降生的,他只能约束父子控件之间的关系. ...
- C++强制类型转换操作符 dynamic_cast
dynamic_cast是四个强制类型转换操作符中最特殊的一个,它支持运行时识别指针或引用. >>>>>>>>>>>编译器的RTTI设 ...
- 绘制图形与3D增强技巧(二)----直线图元之点画
一.直线的点画模式:即并不完全填充所有像素来画一条直线,而是用点画的形式,间隔地画一条直线 首先启用点画模式: glEnable(GL_LINE_STIPPLE); 然后自定义创建自己的点画模式 gl ...
- Leetcode 160. Intersection of two linked lists
Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...
- 策略设计模式与c语言中的函数指针
在C语言中有一个非常重要的概念-函数指针,其最重要的功能是实现回调函数(指函数先在某处注册,而它将在稍后某个需要的时候被调用)在java语言中没有指针的概念,但是可以利用接口和指针实现类似的功能,具体 ...
- cmd 利用IE打开网页
"C:\Program Files\Internet Explorer\iexplore.exe" "http://dmsite.chinacloudsites.cn/r ...