日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

python mysqldb安装_解决centos7 安装MySQLdb-python 报错 方案

發布時間:2024/10/6 数据库 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python mysqldb安装_解决centos7 安装MySQLdb-python 报错 方案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

運行?pip install?MySQL-Python?報錯:

云服務器

Command?python?setup.py?egg_info?failed?with?error?code?1?in

繼續試探

yum?install?mysql-devel

systemctl?restart?mariadb

之后再安裝報錯:

Command?"/usr/bin/python?-u?-c?"import?setuptools,?tokenize;__file__='/tmp/pip-build-GMXMYA/MySQL-python/setup.py';f=getattr(tokenize,?'open',?open)(__file__);code=f.read().replace('

',?'

');f.close();exec(compile(code,?__file__,?'exec'))"?install?--record?/tmp/pip-VMNV_c-record/install-record.txt?--single-version-externally-managed?--compile"?failed?with?error?code?1?in?/t

mp/pip-build-GMXMYA/MySQL-python/

繼續找安裝

yum?install?MySQL-python

systemctl?restart?mariadb

測試是否安裝成功

python

進入 python之后 執行

>>>?import?MySQLdb

>>>?print?dir(MySQLdb)

['BINARY',?'Binary',?'Connect',?'Connection',?'DATE',?'DATETIME',?'DBAPISet',?'DataError',?'DatabaseError',?'Date',?'DateFromTicks',?'Error',?'FIELD_TYPE',?'IntegrityError',?'InterfaceError',?'InternalError',?'MySQLError',?'NULL',?'NUMBER',?'NotSupportedError',?'OperationalError',?'ProgrammingError',?'ROWID',?'STRING',?'TIME',?'TIMESTAMP',?'Time',?'TimeFromTicks',?'Timestamp',

'TimestampFromTicks',?'Warning',?'__all__',?'__author__',?'__builtins__',?'__doc__',?'__file__',?'__name__',?'__package__',?'__path__',?'__revision__',?'__version__',?'_mysql',?'apilevel',?'

connect',?'connection',?'constants',?'debug',?'escape',?'escape_dict',?'escape_sequence',?'escape_string',?'get_client_info',?'paramstyle',?'release',?'result',?'server_end',?'server_init',

'string_literal',?'test_DBAPISet_set_equality',?'test_DBAPISet_set_equality_membership',?'test_DBAPISet_set_inequality',?'test_DBAPISet_set_inequality_membership',?'thread_safe',?'threadsafe

ty',?'times',?'version_info']

因為系統用?yum install MySQLdb-python?來替代?pip install MySQLdb-python?Author:

總結

以上是生活随笔為你收集整理的python mysqldb安装_解决centos7 安装MySQLdb-python 报错 方案的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。