Я нашел mysqllib на http://www.mysql.com/downloads/connector/c/.
Так можно ли установить MySQLdb без установки MySQL Server?
Просто скопируйте mysqlib в /usr/local/mysql
?
Возможно ли это?И как это сделать?
И какая версия будет соответствовать моей машине (я использую OSX Lion)?
Я хочу использовать ее для подключения к серверу MySQL на другой машине для Django.
Спасибо за помощь!
===============================
То, что я уже пробовал
скачать http://www.mysql.com/downloads/connector/c/ 64-бит
извлечь в / usr / local /mysql
загрузить MySQL-python-1.2.3
создать символическую ссылку gcc-4.2 на gcc (поскольку при компиляции запускается gcc-4.2 вместо gcc)
в папке MySQL-python-1.2.3 отредактируйте setup_posix.py edit mysql_config.path = "/ usr / local / mysql / bin / mysql_config"
sudo python setup.py clean
редактировать _mysql.c каждый включает mysqllib в правильный путь
пример#include "mysql.h" ===> #include "/usr/local/mysql/include/mysql.h"
- sudo python setup.py build
а такжеЯ нашел эту ошибку
Oats-MacBook:MySQL-python-1.2.3 Oat$ sudo python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.6-intel-2.7
creating build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
creating build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.6-intel-2.7
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o
In file included from _mysql.c:36:
/usr/local/mysql/include/my_config.h:185:1: warning: "SIZEOF_LONG" redefined
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:9,
from pymemcompat.h:10,
from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:54:1: warning: this is the location of the previous definition
In file included from _mysql.c:36:
/usr/local/mysql/include/my_config.h:205:1: warning: "SIZEOF_SIZE_T" redefined
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:9,
from pymemcompat.h:10,
from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:1: warning: this is the location of the previous definition
gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/_mysql.o -L/usr/local/lib -lmysql -lpthread -o build/lib.macosx-10.6-intel-2.7/_mysql.so
ld: warning: directory not found for option '-L/usr/local/lib'
ld: library not found for -lmysql
collect2: ld returned 1 exit status
ld: warning: directory not found for option '-L/usr/local/lib'
ld: library not found for -lmysql
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccnEbgua.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1