首頁 > 資料庫 > mysql教程 > mac osx安装mysql mysql

mac osx安装mysql mysql

ringa_lee
發布: 2018-05-11 15:18:50
原創
2359 人瀏覽過

两天的折腾结果: 问题一: 

import MySQLdb Traceback (most recent call last): File stdin, line 1, in module File /Library/Python/2.7/
site-packages/MySQLdb/__init__.py, line 19, in module import _mysql ImportError: dlopen(/Library/Python/2.7/
登入後複製

两天的折腾结果:

问题一:

import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/_mysql.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Library/Python/2.7/site-packages/_mysql.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/_mysql.so
关闭mysql 重新安装mysql-python:
admin$:mysql.server stop
admin$:sudo pip uninstall MySQL-python
admin$:sudo pip install MySQL-python
登入後複製

问题二:

  Traceback (most recent call last):
       ...
       import MySQLdb
     File "/Users/cole/Library/Python/2.5/site-packages/MySQLdb/__init__.py", line 19, in <module>
       import _mysql
   ImportError: dlopen(/Users/cole/Library/Python/2.5/site-packages/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
     Referenced from: /Users/cole/Library/Python/2.5/site-packages/_mysql.so
     Reason: no suitable image found.  Did find:
       /usr/local/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
       /usr/local/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture

pip uninstall MySQL-python
brew uninstall mysql
brew install mysql --universal
pip install MySQL-python
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板