import MySQLdb A solution for those who get an error and cannot read.
The procedure is 3 + α.
(1) Install MySQL-python from the following URL. http://sourceforge.net/projects/mysql-python/ Please download it from, place it in a suitable place, and expand it by double-clicking.
(2) Next, edit site.cfg. Add the following line to "site.cfg".
The content to be added is
$ which mysql_config
/usr/local/bin/mysql_config
↑ This is it.
mysql_config = /usr/local/bin/mysql_config
(3) Type the following command from the console to "Build & Install"
$ python setup.py build
$ sudo python setup.py install
Load "import MySQL db" again from another window.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/me/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libssl.1.0.0.dylib
Referenced from: /Users/me/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: image not found
If the above error occurs, execute the following command.
(+α)``` brew unlink openssl && brew link openssl --force
Load MySQL db from the terminal.
![スクリーンショット 2016-03-02 12.34.22.png](https://qiita-image-store.s3.amazonaws.com/0/105887/679c32c5-b115-2c1f-9929-9468bd8efa24.png)
that's all.
Recommended Posts