当前位置:Gxlcms > 数据库问题 > python[error] - mysql_config not found

python[error] - mysql_config not found

时间:2021-07-01 10:21:17 帮助过:20人阅读


mysql_config是来自于 mysql-devel ,我用的是MySQL社区版,所以实际安装的是mysql-community-devel,网上的说法是同时安装python-devel,如果你没有安装的话一起安装

yum install python-devel mysql-community-devel -y

安装完成之后尝试再次 pip 安装 MySQL-python


再次安装

root@pts/4 $ pip install MySQL-python
Collecting MySQL-python
  Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python
  Running setup.py install for MySQL-python ... done
Successfully installed MySQL-python-1.2.5

验证

root@pts/1 $ python
Python 2.7.5 (default, Sep 15 2016, 22:37:39) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> MySQLdb.
MySQLdb.BINARY                                    MySQLdb.OperationalError(                         MySQLdb.__hash__(                                 MySQLdb.debug(
MySQLdb.Binary(                                   MySQLdb.ProgrammingError(                         MySQLdb.__init__(                                 MySQLdb.escape(
MySQLdb.Connect(                                  MySQLdb.ROWID                                     MySQLdb.__name__                                  MySQLdb.escape_dict(
MySQLdb.Connection(                               MySQLdb.STRING                                    MySQLdb.__new__(                                  MySQLdb.escape_sequence(
MySQLdb.DATE                                      MySQLdb.TIME                                      MySQLdb.__package__                               MySQLdb.escape_string(
MySQLdb.DATETIME                                  MySQLdb.TIMESTAMP                                 MySQLdb.__path__                                  MySQLdb.get_client_info(
MySQLdb.DBAPISet(                                 MySQLdb.Time(                                     MySQLdb.__reduce__(                               MySQLdb.paramstyle
MySQLdb.DataError(                                MySQLdb.TimeFromTicks(                            MySQLdb.__reduce_ex__(                            MySQLdb.release
MySQLdb.DatabaseError(                            MySQLdb.Timestamp(                                MySQLdb.__repr__(                                 MySQLdb.result(
MySQLdb.Date(                                     MySQLdb.TimestampFromTicks(                       MySQLdb.__revision__                              MySQLdb.server_end(
MySQLdb.DateFromTicks(                            MySQLdb.Warning(                                  MySQLdb.__setattr__(                              MySQLdb.server_init(
MySQLdb.Error(                                    MySQLdb.__all__                                   MySQLdb.__sizeof__(                               MySQLdb.string_literal(
MySQLdb.FIELD_TYPE                                MySQLdb.__author__                                MySQLdb.__str__(                                  MySQLdb.test_DBAPISet_set_equality(
MySQLdb.IntegrityError(                           MySQLdb.__class__(                                MySQLdb.__subclasshook__(                         MySQLdb.test_DBAPISet_set_equality_membership(
MySQLdb.InterfaceError(                           MySQLdb.__delattr__(                              MySQLdb.__version__                               MySQLdb.test_DBAPISet_set_inequality(
MySQLdb.InternalError(                            MySQLdb.__dict__                                  MySQLdb._mysql                                    MySQLdb.test_DBAPISet_set_inequality_membership(
MySQLdb.MySQLError(                               MySQLdb.__doc__                                   MySQLdb.apilevel                                  MySQLdb.thread_safe(
MySQLdb.NULL                                      MySQLdb.__file__                                  MySQLdb.connect(                                  MySQLdb.threadsafety
MySQLdb.NUMBER                                    MySQLdb.__format__(                               MySQLdb.connection(                               MySQLdb.times
MySQLdb.NotSupportedError(                        MySQLdb.__getattribute__(                         MySQLdb.constants                                 MySQLdb.version_info
>>> 
>>> MySQLdb.version_info
(1, 2, 5, ‘final‘, 1)
>>> 


作者:全栈运维
链接:https://www.jianshu.com/p/827cf26568d8
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

python[error] - mysql_config not found

标签:amp   member   cal   base   cached   dba   hash   ali   sizeof   

人气教程排行