Re: [Pythonmac-SIG] MySQLdb on OS X 10.6
Thank you so much Ned!!! I completely overlooked that after reinstalling mysql via macports. I added the db, user, pw, and everything worked perfectly! There's hope for me and Django after all haha. Again, I really appreciate your help and time, saving my n00bness to python and Django! -- View this message in context: http://old.nabble.com/MySQLdb-on-OS-X-10.6-tp26311352p30096268.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] MySQLdb on OS X 10.6
Hi Ned, I really appreciate the reply! I finally made some progress after daunting attempts to get msyql up and running from macports. Ultimately it had to do with some permission issues. Anyway, I can feel a tad bit closer, but am still running into a roadblock: $~/ python Python 2.6.6 (r266:84292, Oct 27 2010, 13:07:13) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. import MySQLdb /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet Moreover, once I try the syncdb command in django, I get: $~/Sandbox/mysite/ ./manage.py syncdb /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet Traceback (most recent call last): File ./manage.py, line 11, in module execute_manager(settings) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py, line 438, in execute_manager utility.execute() File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py, line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py, line 191, in run_from_argv self.execute(*args, **options.__dict__) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py, line 219, in execute self.validate() File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py, line 249, in validate num_errors = get_validation_errors(s, app) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/validation.py, line 86, in get_validation_errors connection.validation.validate_field(e, opts, f) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/validation.py, line 14, in validate_field db_version = self.connection.get_server_version() File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/base.py, line 313, in get_server_version self.cursor() File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/__init__.py, line 75, in cursor cursor = self._cursor() File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/base.py, line 297, in _cursor self.connection = Database.connect(**kwargs) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py, line 74, in Connect return Connection(*args, **kwargs) File /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/connections.py, line 170, in __init__ super(Connection, self).__init__(*args, **kwargs2) _mysql_exceptions.OperationalError: (1045, Access denied for user 'admin'@'localhost' (using password: YES)) Again, thanks so much! It's a bit of a relief that I've made it this far! -- View this message in context: http://old.nabble.com/MySQLdb-on-OS-X-10.6-tp26311352p30087228.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] MySQLdb on OS X 10.6
In article 30087228.p...@talk.nabble.com, brinsknaps brian.ngu...@gmail.com wrote: I really appreciate the reply! I finally made some progress after daunting attempts to get msyql up and running from macports. Ultimately it had to do with some permission issues. Anyway, I can feel a tad bit closer, but am still running into a roadblock: $~/ python Python 2.6.6 (r266:84292, Oct 27 2010, 13:07:13) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. import MySQLdb /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site -packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet Fortunately, that warning can be ignored; it should have no impact on anything. It is an indication, however, that the MySQLdb version in MacPorts has not been updated yet from 1.2.2 to 1.2.3, which was released earlier this year and, among other changes, removes the source of that warning. Unless you find some other reason that you need to update to 1.2.3, I'd advise just living with the warning until the MacPorts port is updated and you feel like updating everything: $ sudo port selfupdate $ sudo port upgrade outdated Moreover, once I try the syncdb command in django, I get: $~/Sandbox/mysite/ ./manage.py syncdb [...] /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit e-packages/MySQLdb/connections.py, line 170, in __init__ super(Connection, self).__init__(*args, **kwargs2) _mysql_exceptions.OperationalError: (1045, Access denied for user 'admin'@'localhost' (using password: YES)) Most likely you don't have the correct values in your Django project's settings.py file for one or more of the DATABASE_ variables. First, make sure your MySQL server is up and running and that you can connect to it using one of the standard MySQL command line programs like mysqladmin5 using a valid MySQL user name and password. Then edit settings.py appropriately. -- Ned Deily, n...@acm.org ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] MySQLdb on OS X 10.6
Hey Brian, I know it's been a long time since you posted this message, but I've been pulling out my hair running into the same issue. I've tried installing 32-bit and 64-bit versions of mysql to test different compatibilities with python 2.6.6, but have had no luck. By any chance did you figure out a solution to this problem? Thanks! Brian -- View this message in context: http://old.nabble.com/MySQLdb-on-OS-X-10.6-tp26311352p30054281.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] MySQLdb on OS X 10.6
In article 30054281.p...@talk.nabble.com, brinsknaps brian.ngu...@gmail.com wrote: I know it's been a long time since you posted this message, but I've been pulling out my hair running into the same issue. I've tried installing 32-bit and 64-bit versions of mysql to test different compatibilities with python 2.6.6, but have had no luck. By any chance did you figure out a solution to this problem? The key to successfully installing MySQLdb on 10.6 is to ensure that the Python version, MySQLdb, and the MySQL client libraries are all built with a common architecture (i386 or x86_64) and ABI (deployment target). Unfortunately, that's easier said than done if you try to do it yourself from source or with installers from various sources. It can be done but my advice is to install everything from MacPorts (http://www.macports.org/). If you haven't already, download and run the base MacPorts installer. Then you can build and install everything you need with: $ sudo /opt/local/bin/port selfupdate $ sudo /opt/local/bin/port install py26-mysql py26-mysql is the MacPorts port name for MySqLdb and installing it will automatically also build all necessary dependencies like Python 2.6 and the MySQL client libraries and they will be built compatibly. To prefer the MacPorts python2.6, add its framework bin directory to the front of your shell search PATH, so something like; $ export PATH=/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin: /opt/local/bin:$PATH You'll find more suggestions and details by searching on StackOverflow. -- Ned Deily, n...@acm.org ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] MySQLdb on OS X 10.6
Hi, Brian I don't think python2.5 shipped with Snow Leopard is 64 bit. If you want to build using pyhton 2.5 it will have to be 32bit. -- Emanuele. On Nov 11, 2009, at 5:28 PM, Brian Zambrano wrote: Hi all, Like many others before me, I'm banging my head against the wall trying to get MySQLdb working on my new MacBook Pro with Snow Leopard. I have MySql 5.1 x86_64 installed, configured and running. I'm building MySQLdb 1.2.3c1 like this: export ARCHFLAGS='-arch x86_64' python setup.py build python setup.py install But it simply doesn't workand apparently I'm not the only one: (eb)bri...@eb-brianz$ python -c import MySQLdb Traceback (most recent call last): File string, line 1, in module File MySQLdb/__init__.py, line 19, in module import _mysql ImportError: dlopen(./_mysql.so, 2): no suitable image found. Did find: ./_mysql.so: mach-o, but wrong architecture Everything *looks* ok: (eb)bri...@eb-brianz$ file _mysql.so _mysql.so: Mach-O 64-bit bundle x86_64 (eb)bri...@eb-brianz$ otool -L _mysql.so _mysql.so: /usr/local/mysql/lib/libmysqlclient_r.16.dylib (compatibility version 17.0.0, current version 17.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1) (eb)bri...@eb-brianz$ (eb)bri...@eb-brianz$ file /usr/local/mysql/lib/libmysqlclient_r. 16.dylib /usr/local/mysql/lib/libmysqlclient_r.16.dylib: Mach-O 64-bit dynamically linked shared library x86_64 Huh? Something is not right here. It sucks that the OS X builds are so painful. I'm sort of at a loss at where to go next. Suggestions? Any help greatly appreciated! BZ BTW...here are the relevant lines from the build: creating build/temp.macosx-10.6-i386-2.5 gcc-4.2 -fno-strict-aliasing -mno-fused-madd -fno-common -dynamic - DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/ include/ffi -DENABLE_DTRACE -pipe -Dversion_info=(1,2,3,'gamma',1) - D__version__=1.2.3c1 -I/usr/local/mysql/include -I/System/Library/ Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.6-i386-2.5/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE - DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT - DDONT_DECLARE_CXA_PURE_VIRTUAL In file included from _mysql.c:36: /usr/local/mysql/include/my_config.h:1049:1: warning: HAVE_WCSCOLL redefined In file included from /System/Library/Frameworks/Python.framework/ Versions/2.5/include/python2.5/Python.h:8, from pymemcompat.h:10, from _mysql.c:29: /System/Library/Frameworks/Python.framework/Versions/2.5/include/ python2.5/pyconfig.h:725:1: warning: this is the location of the previous definition gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch x86_64 build/ temp.macosx-10.6-i386-2.5/_mysql.o -L/usr/local/mysql/lib - lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.6-i386-2.5/ _mysql.so ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig -- Emanuele. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig