Install mysqlmysql on macosx

Source: Internet
Author: User
Two-day tossing results: Question 1: importMySQLdbTraceback (mostrecentcalllast): Filestdin, line1, queue-packagesMySQLdb _ init _. py, line19, encoding: dlopen (LibraryPython2.7

Result of two days: Question 1: 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/

Two days of tossing results:

Question 1:

Import MySQLdb

Traceback (most recent call last ):
File" ", Line 1, in
File "/Library/Python/2.7/site-packages/MySQLdb/_ init _. py", line 19, in
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

Close mysql and reinstall mysql-python:

Admin $: mysql. server stop

Admin $: sudo pip uninstall MySQL-python

admin$:sudo pip install MySQL-python


Question 2:


    Traceback (most recent call last):        ...        import MySQLdb      File "/Users/cole/Library/Python/2.5/site-packages/MySQLdb/__init__.py", line 19, in 
     
              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-pythonbrew uninstall mysqlbrew install mysql --universalpip install MySQL-python

Refer:

http://madebyhoundstooth.com/blog/install-mysql-on-mountain-lion-with-homebrew/

https://gist.github.com/cole/1272701

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.