Home >Database >Mysql Tutorial >How to Successfully Install MySQLdb on macOS?
How to Install MySQLdb on Mac OS X
MySQLdb is a Python data access library that enables interaction with MySQL databases. Installing MySQLdb on Mac OS X requires a specific set of steps to ensure compatibility with the system's environment.
Preparation
Before proceeding with the installation, verify that MySQL, Python, and GCC are installed on your Mac.
Installation Steps
Additional Troubleshooting
If you encounter an error related to libmysqlclient.18.dylib being missing, create a symbolic link: sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib.
To resolve the warning about _mysql being already imported, change the directory to the parent of the build directory.
Python 3 Users
For Python 3, install the necessary libraries using: conda install mysqlclient. This will install mysqlclient, mysql-connector, and llvmdev.
The above is the detailed content of How to Successfully Install MySQLdb on macOS?. For more information, please follow other related articles on the PHP Chinese website!