缺乏解决问题的勇气(如何解决缺失问题的方法)

lxf2023-11-25 11:20:01

mysql配置不足的解决方法:首先,使用检查mysql的安装;然后删除现有的安装包;然后下载64位rpm文件;最后,重用“rpm-IVH MySQL-devel-5 . 5 . 16-1 . Linux……”来安装。

推荐:mysql教程

MySQL缺少mysql_config文件

问题:

工作中需要安排Django-sentry日志服务器,pip在centos-6.4上安装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 lib MySQL client-dev,但是apt-get是Debian和Ubuntu系列的网络安装命令,yum是Redhat、Centos和Fedora的网络安装命令,然后我们发现Centos上应该安装mysql-devel。

2.yum安装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重新安装mysql-devel,发现与mysql-server和mysql-client版本冲突。

6.去网上找同版本下载http://downloads.skysql.com/archive/index/p/mysql/v/5.5.16,下载64位rpm文件,用rpm-IVH MySQL-devel-5.5.16-1安装。Linux 2.6.x86 _ 64.rpm。

7.安装成功后,转到/usr/bin/目录,发现已经生成了mysql_config文件,继续pip安装mysql-python,成功完成。

以上是如何解决mysql config缺失问题的细节。更多信息请关注AdminJS.cn其他相关文章!

adminjs.cn是一个以CSS、JavaScript、Vue、HTML为核心的前端开发技术网站。我们致力于为广大前端开发者提供专业、全面、实用的前端开发知识和技术支持。 在本网站中,您可以学习到最新的前端开发技术,了解前端开发的最新趋势和最佳实践。我们提供丰富的教程和案例,让您可以快速掌握前端开发的核心技术和流程。 Adminjs.cn还提供一系列实用的工具和插件,帮助您更加高效地进行前端开发工作。我们提供的工具和插件都经过精心设计和优化,可以帮助您节省时间和精力,提升开发效率。 在Adminjs.cn中,您可以找到您需要的一切前端开发资源,让您成为一名更加优秀的前端开发者。欢迎您加入我们的大家庭,一起探索前端开发的无限可能!