Alpine Install Mysql Client

2/12/2022by admin

Motivation

MysqlAlpine Install Mysql Client

PHP7 docker image with useful extensions based on alpine & debian php:7-fpm image - php7/Dockerfile at master m2sh/php7. # install mysql-client for using. PHP7 docker image with useful extensions based on alpine & debian php:7-fpm image - php7/Dockerfile at master m2sh/php7. # install mysql-client for using.

We are trying to use Django to connect to MySQL remote server.

Error

There is a common error when connecting to an external MySQL database that even if you install in your environment all the mysql connectors, it will throw an error. This is the error:

Alpine Install Mysql Client On Windows

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclient?

Fix

Alpine Install Mysql Client On Mac

In your enviroment, run pip install pymysql

Then, edit the init.py file in your project origin dir(the same as settings.py)

add:

Now try to connect again. If you get some weird error such as segmentation fault, check if you installed the connector via homebrew. The way they recommend to do it (which didn't work for me is this: https://github.com/PyMySQL/mysqlclient-python). If you installed that way via homebrew, just uninstall it (mysqlclient-python) and try to connect again.

Alpine Install Mysql Client Free

Let me know if you have any questions below.

Comments are closed.