当前位置:首页 > 开发 > 数据库 > 正文

MySQL缺失mysql_config文件

发表于: 2013-11-21   作者:薰衣草之子   来源:转载   浏览:
摘要: 问题:工作中需要布置django-sentry日志服务器,在centos-6.4上pip install mysql-python,报错如下[sentry@kjtest111 mysql-python]$ pip install mysql-pythonDownloading/unpacking mysql-python  Running setup.py egg_info for pa

问题:工作中需要布置django-sentry日志服务器,在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文件

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
其中一个典型的问题就是安装photoshop时出现缺失文件,如下图 一般遇到这种问题我只能卸掉重装,不
今天给客户远程在Windows2003 SP2上安装Oracle10.2.0报"暂存路径缺失jre"(报错参考如下图),找了一
有这样一个数组,它包含 1 - n 中的 n - 1 个数,缺少的那个数不知道,怎样才能找到那个数? 这里有
要在mac os上安装 mysqldb 首先,下载MySQLdb:http://sourceforge.net/projects/mysql-python/ 下
  ①首先,单击菜单栏--插入--表格,绘制1个4*4的方形矩阵,便于我们插图,从而减去了手动画矩形
SQLSERVER如何查看索引缺失 当大家发现数据库查询性能很慢的时候,大家都会想到加索引来优化数据库
menuconfig 缺失 yaffs support 解决办法 一个干净的内核可能不会自动包括或支持YAFFS,.config 里
这里的几个rpm意义分别是:(http://docs.oracle.com/cd/E17952_01/refman-5.0-en/linux-installati
由于最近碰到一个日志清理的问题,所以就花时间写了这篇文章,严格来说只是学习笔记。 1.通用日志文
MySQL 5.5 官方文档上有关日志的分类: By default, nologs are enabled. The following log-specif
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号