The following will show how to setup MySQL Server first, and setup Django to work with MySQL. This works with the Mac OS only.
brew install mysql
Since MySQL gets setup without a proper root password, you need to secure it. Run the following utility to do so:
mysql_secure_installation
brew services start mysql
If you don't want/need a background service you can just run:
mysql.server start
brew install openssl
Now setup the path so that when pip
or pipenv
installs, it knows where OpenSSL is found.
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
If you're using pip
, run:
pip install mysqlclient
If you're using pipenv
, run:
pipenv install mysqlclient