Mysql:
After upgrading the Mac to osx10.9, MySQL server can not be used, on the Internet to find the data said OSX 10.9 under the server software has been a lot of upgrades, so re-download the appropriate 10.9 MySQL server
: http://dev.mysql.com/downloads/mysql/, open and download the DMG version of osx10.9.
OS X 10.9 is a pure 64-bit operating system. There is no need to register when downloading, find No Thanks, just start my download. can be.
When the download is complete, open System Preferences, click MySQL, and open the server.
PYTHON-MYSQLDB:
Previously said Max OS X installed MySQL, we need to use Python to access the MySQL database, need to install the MySQLdb module, the method is as follows:
Download the MySQLdb module at the following URL:
http://sourceforge.net/projects/mysql-python/
In Mac OS X directly double-click Unzip, command line into the extracted directory, execute python setup.py build
If there is
sh: mysql_config: command not found
Tip, we need to edit the path under MySQL and use vim to open the setup_posix.py
Found it:
mysql_config.path = "mysql_config"
Switch
mysql_config.path = "/usr/local/mysql/bin/mysql_config"
Then execute:
sudo python setup.py install
After the installation succeeds, enter Python into the Python environment at the command line, enter import MySQLdb, and report the following error in my environment:
>>> import MySQLdbTraceback (most recent call last): File "<stdin>", line 1, in <module> File "MySQLdb/__init__.py", line 19, in </module><module> import _mysqlImportError: dlopen(/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.8-intel.egg/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib Referenced from: /Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.8-intel.egg/_mysql.so Reason: image not found
Solution, we build a soft chain on it.
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
This allows us to install the MySQLdb module in the Python environment of Mac OS X.
Mac OS x10.9,mysql and Python related