Menu

MySQLdb / Python / Leopard Connection Prolem

Help
Paul
2007-11-23
2012-09-19
  • Paul

    Paul - 2007-11-23

    Hey all,

    I've managed to compile and install an x86_64 build of MySQL, MySQLdb, and mod_python. Now i'm trying to yse Django to connect to my database. I've setup a root account and password, as well as other accounts for Django. Trying to connect though MySQLdb with any of the accounts (including root) fails with this message:

    self.connection = Database.connect(**kwargs)
    File "/Users/eyk/Sites/mysite/init.py", line 74, in Connect

    File "build/bdist.macosx-10.5-i386/egg/MySQLdb/connections.py", line 170, in init
    _mysql_exceptions.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

    I'm able to connect to MySQL through the MySQL CLI using the exact same username/password, and I'm doing this all on the same machine (i.e., MySQLdb isn't trying to connect to a remote server or anything). I've setup the right permissions for the database I'm trying to use as well. As you might expect, root has superuser permissions throughout MySQL. However, root can't even connect using MySQLdb.. Has anyone else seen this issue with Leopard? Could it be a 64 bit problem? MySQLdb was built as a 4-way Universal binary (i.e., -arch i386 -arch x86_64 -arch ppc -arch ppc64).. I hope someone can point me in the right direction!

    Cheers,

    Paul

     
    • geert

      geert - 2008-03-12

      Hi

      I'm having huge problems trying to do what you apparently have already done, so I 'm hoping you can tell me how you did it!

      I have a mac mini running 10.5.2. As it's a new machine, it will run apps as 64 bit if it can. I want a setup where I can use MySQL with MySQLdb. And I'll be using mod_wsgi - at least, that's the setup works for me on my older MacBook Pro, although there, everything runs as 32-bit app.

      I already have MySQL running as 64-bit, and of course apache2 is running as 64-bit, but that's beside the point at the moment because for the life of me I can't get MySQLdb running.

      This is what python says:

      Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
      [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import _mysql
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in <module>
      File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in bootstrap
      ImportError: dynamic module does not define init function (init_mysql)

      Any ideas?

      Geert

       
      • Andy Dustman

        Andy Dustman - 2008-03-12

        MySQL and Python both need to be 64-bit versions, or both 32-bit. You can't mix them.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.