Rumah > pangkalan data > tutorial mysql > mac osx安装mysql mysql

mac osx安装mysql mysql

ringa_lee
Lepaskan: 2018-05-11 15:18:50
asal
2355 orang telah melayarinya

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

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/
Salin selepas log masuk

两天的折腾结果:

问题一:

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
Salin selepas log masuk

问题二:

  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
Salin selepas log masuk
Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan