设为首页 收藏本站
查看: 454|回复: 0

[经验分享] 【MySQL】MySQL-python my_config.h

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-11-2 10:31:25 | 显示全部楼层 |阅读模式
////// 问题描述:安装 MySQL-python 出错
////// 解决思路: 用yum重装mysql,再试试
////// 难点: 重装MySQL,并且改变数据文件夹的位置,还会涉及到socket,进而影响php连MySQL

///
/// install MySQL-python-1.2.5
///
[iyunv@wode004 MySQL-python-1.2.5]# python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing
_mysql.c:44:23: 致命错误:my_config.h:没有那个文件或目录
#include "my_config.h"
                       ^
编译中断。
error: command 'gcc' failed with exit status 1
[iyunv@wode004 MySQL-python-1.2.5]#


///
/// yum install mysql-devel
///
Transaction check error:
  file /usr/bin/mysql_config-64 from install of mysql-community-devel-5.6.27-2.el7.x86_64 conflicts with file from package mysql-community-client-5.6.26-2.el7.x86_64


///
/// yum remove mysql-libs
///
================================================================================
正在删除:
mysql-community-libs    x86_64  5.6.26-2.el7         @mysql56-community  9.2 M
mysql-community-libs    x86_64  5.6.27-2.el7         installed           9.2 M
为依赖而移除:
mysql-community-client  x86_64  5.6.26-2.el7         @mysql56-community   88 M
mysql-community-client  x86_64  5.6.27-2.el7         installed            88 M
mysql-community-server  x86_64  5.6.27-2.el7         @mysql56-community  245 M
perl-DBD-MySQL          x86_64  4.023-5.el7          @anaconda           323 k
postfix                 x86_64  2:2.10.1-6.el7       @anaconda            12 M
qt-mysql                x86_64  1:4.8.5-8.el7        @anaconda            74 k
redhat-lsb              x86_64  4.1-27.el7.centos.1  @base               0.0  
redhat-lsb-core         x86_64  4.1-27.el7.centos.1  @base                45 k
redhat-lsb-cxx          x86_64  4.1-27.el7.centos.1  @base               0.0  
redhat-lsb-desktop      x86_64  4.1-27.el7.centos.1  @base               0.0  
redhat-lsb-languages    x86_64  4.1-27.el7.centos.1  @base               814  
redhat-lsb-printing     x86_64  4.1-27.el7.centos.1  @base               0.0  

事务概要
================================================================================
移除  2 软件包 (+12 依赖软件包)

安装大小:451 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在删除    : redhat-lsb-4.1-27.el7.centos.1.x86_64                      1/14
  正在删除    : redhat-lsb-cxx-4.1-27.el7.centos.1.x86_64                  2/14
  正在删除    : redhat-lsb-desktop-4.1-27.el7.centos.1.x86_64              3/14
  正在删除    : redhat-lsb-languages-4.1-27.el7.centos.1.x86_64            4/14
  正在删除    : redhat-lsb-printing-4.1-27.el7.centos.1.x86_64             5/14
  正在删除    : redhat-lsb-core-4.1-27.el7.centos.1.x86_64                 6/14
  正在删除    : 2:postfix-2.10.1-6.el7.x86_64                              7/14
  正在删除    : perl-DBD-MySQL-4.023-5.el7.x86_64                          8/14
  正在删除    : mysql-community-server-5.6.27-2.el7.x86_64                 9/14
警告:文件 /var/lib/mysql: 移除失败: 没有那个文件或目录
警告:/etc/my.cnf 已另存为 /etc/my.cnf.rpmsave
  正在删除    : mysql-community-client.x86_64                             10/14
  正在删除    : 1:qt-mysql-4.8.5-8.el7.x86_64                             11/14
  正在删除    : mysql-community-client.x86_64                             12/14
  正在删除    : mysql-community-libs.x86_64                               13/14
  正在删除    : mysql-community-libs.x86_64                               14/14
  验证中      : mysql-community-client-5.6.26-2.el7.x86_64                 1/14
  验证中      : 1:qt-mysql-4.8.5-8.el7.x86_64                              2/14
  验证中      : mysql-community-libs-5.6.26-2.el7.x86_64                   3/14
  验证中      : redhat-lsb-core-4.1-27.el7.centos.1.x86_64                 4/14
  验证中      : redhat-lsb-desktop-4.1-27.el7.centos.1.x86_64              5/14
  验证中      : redhat-lsb-4.1-27.el7.centos.1.x86_64                      6/14
  验证中      : mysql-community-server-5.6.27-2.el7.x86_64                 7/14
  验证中      : redhat-lsb-languages-4.1-27.el7.centos.1.x86_64            8/14
  验证中      : mysql-community-client-5.6.27-2.el7.x86_64                 9/14
  验证中      : 2:postfix-2.10.1-6.el7.x86_64                             10/14
  验证中      : mysql-community-libs-5.6.27-2.el7.x86_64                  11/14
  验证中      : perl-DBD-MySQL-4.023-5.el7.x86_64                         12/14
  验证中      : redhat-lsb-printing-4.1-27.el7.centos.1.x86_64            13/14
  验证中      : redhat-lsb-cxx-4.1-27.el7.centos.1.x86_64                 14/14

删除:
  mysql-community-libs.x86_64 0:5.6.26-2.el7                                    
  mysql-community-libs.x86_64 0:5.6.27-2.el7                                    

作为依赖被删除:
  mysql-community-client.x86_64 0:5.6.26-2.el7                                 
  mysql-community-client.x86_64 0:5.6.27-2.el7                                 
  mysql-community-server.x86_64 0:5.6.27-2.el7                                 
  perl-DBD-MySQL.x86_64 0:4.023-5.el7                                          
  postfix.x86_64 2:2.10.1-6.el7                                                
  qt-mysql.x86_64 1:4.8.5-8.el7                                                
  redhat-lsb.x86_64 0:4.1-27.el7.centos.1                                       
  redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1                                 
  redhat-lsb-cxx.x86_64 0:4.1-27.el7.centos.1                                   
  redhat-lsb-desktop.x86_64 0:4.1-27.el7.centos.1                              
  redhat-lsb-languages.x86_64 0:4.1-27.el7.centos.1                             
  redhat-lsb-printing.x86_64 0:4.1-27.el7.centos.1                              

完毕!
[iyunv@wode004 etc]#


///
/// yum install mysql-devel
///
依赖关系解决

================================================================================
Package                  架构      版本             源                    大小
================================================================================
正在安装:
mysql-community-devel    x86_64    5.6.27-2.el7     mysql56-community    3.4 M
为依赖而安装:
mysql-community-libs     x86_64    5.6.27-2.el7     mysql56-community    2.0 M

事务概要
================================================================================
安装  1 软件包 (+1 依赖软件包)

总计:5.4 M
总下载量:2.0 M
安装大小:30 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-community-libs-5.6.27-2.el7.x86_64.rpm               | 2.0 MB   00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mysql-community-libs-5.6.27-2.el7.x86_64                    1/2
  正在安装    : mysql-community-devel-5.6.27-2.el7.x86_64                   2/2
  验证中      : mysql-community-devel-5.6.27-2.el7.x86_64                   1/2
  验证中      : mysql-community-libs-5.6.27-2.el7.x86_64                    2/2

已安装:
  mysql-community-devel.x86_64 0:5.6.27-2.el7                                   

作为依赖被安装:
  mysql-community-libs.x86_64 0:5.6.27-2.el7                                    

完毕!
[iyunv@wode004 etc]#


///
/// yum install mysql
///
依赖关系解决

================================================================================
Package                   架构      版本            源                    大小
================================================================================
正在安装:
mysql-community-client    x86_64    5.6.27-2.el7    mysql56-community     19 M

事务概要
================================================================================
安装  1 软件包

总下载量:19 M
安装大小:88 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-community-client-5.6.27-2.el7.x86_64.rpm             |  19 MB   00:48     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mysql-community-client-5.6.27-2.el7.x86_64                  1/1
  验证中      : mysql-community-client-5.6.27-2.el7.x86_64                  1/1

已安装:
  mysql-community-client.x86_64 0:5.6.27-2.el7                                 

完毕!
[iyunv@wode004 ~]#


///
/// yum install mysql-server
///
[iyunv@wode004 ~]# yum install mysql-server
依赖关系解决

================================================================================
Package                   架构      版本            源                    大小
================================================================================
正在安装:
mysql-community-server    x86_64    5.6.27-2.el7    mysql56-community     58 M

事务概要
================================================================================
安装  1 软件包

总下载量:58 M
安装大小:245 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-community-server-5.6.27-2.el7.x86_64.rpm             |  58 MB   02:31     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mysql-community-server-5.6.27-2.el7.x86_64                  1/1
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
  验证中      : mysql-community-server-5.6.27-2.el7.x86_64                  1/1

已安装:
  mysql-community-server.x86_64 0:5.6.27-2.el7                                 

完毕!
[iyunv@wode004 ~]# ls


///
/// python setup.py build
///
[iyunv@wode004 MySQL-python-1.2.5]# python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing
In file included from /usr/include/mysql/my_config.h:27:0,
                 from _mysql.c:44:
/usr/include/mysql/my_config_x86_64.h:442:0: 警告:“HAVE_WCSCOLL”重定义 [默认启用]
#define HAVE_WCSCOLL
^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from _mysql.c:29:
/usr/include/python2.7/pyconfig-64.h:908:0: 附注:这是先前定义的位置
#define HAVE_WCSCOLL 1
^
gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64/mysql -L/usr/lib64 -lmysqlclient -lpthread -lm -ldl -lpython2.7 -o build/lib.linux-x86_64-2.7/_mysql.so
[iyunv@wode004 MySQL-python-1.2.5]#

///
/// python setup.py install
///
[iyunv@wode004 MySQL-python-1.2.5]# python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
running build_ext
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-2.7/_mysql_exceptions.py -> build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/MySQLdb
copying build/lib.linux-x86_64-2.7/MySQLdb/__init__.py -> build/bdist.linux-x86_64/egg/MySQLdb
copying build/lib.linux-x86_64-2.7/MySQLdb/converters.py -> build/bdist.linux-x86_64/egg/MySQLdb
copying build/lib.linux-x86_64-2.7/MySQLdb/connections.py -> build/bdist.linux-x86_64/egg/MySQLdb
copying build/lib.linux-x86_64-2.7/MySQLdb/cursors.py -> build/bdist.linux-x86_64/egg/MySQLdb
copying build/lib.linux-x86_64-2.7/MySQLdb/times.py -> build/bdist.linux-x86_64/egg/MySQLdb
creating build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/__init__.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/CR.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/ER.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/FLAG.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/REFRESH.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/constants/CLIENT.py -> build/bdist.linux-x86_64/egg/MySQLdb/constants
copying build/lib.linux-x86_64-2.7/MySQLdb/release.py -> build/bdist.linux-x86_64/egg/MySQLdb
copying build/lib.linux-x86_64-2.7/_mysql.so -> build/bdist.linux-x86_64/egg
byte-compiling build/bdist.linux-x86_64/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/converters.py to converters.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/connections.py to connections.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/cursors.py to cursors.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/times.py to times.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/CR.py to CR.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/ER.py to ER.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
byte-compiling build/bdist.linux-x86_64/egg/MySQLdb/release.py to release.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.linux-x86_64/egg/_mysql.py to _mysql.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/MySQL_python-1.2.5-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing MySQL_python-1.2.5-py2.7-linux-x86_64.egg
Copying MySQL_python-1.2.5-py2.7-linux-x86_64.egg to /usr/lib64/python2.7/site-packages
Adding MySQL-python 1.2.5 to easy-install.pth file

Installed /usr/lib64/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg
Processing dependencies for MySQL-python==1.2.5
Finished processing dependencies for MySQL-python==1.2.5
[iyunv@wode004 MySQL-python-1.2.5]#


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-133946-1-1.html 上篇帖子: mysql sysbench测试安装及命令 下篇帖子: 【MySQL】迁移数据目录 php
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表