12π
In my opinions mysql_config is missing on your system or the installer could not find it. Please Be sure mysql_config is really installed.
For instance,
-
On Debian/Ubuntu, You must install the package:
sudo apt-get install libmysqlclient-dev -
Running Mac OSX Mountain Lion, I simply ran this in terminal to fix:
export PATH=$PATH:/usr/local/mysql/bin
This is the quickest fix I found.
3π
I was also getting the same error while installing the mysql package by pip But after installing libmysqlclient-dev
- sudo apt install libmysqlclient-dev
- pip install mysql
Now it worked for me..
verified:
import mysql
- did not find any error, Means got installed successfully and working
properly
- [Django]-Django-compressor: disable caching using precompilers
- [Django]-Django celery: Import error β no module named task
1π
Check your mysql configuration file using this:
mysql_config
Now you should get an output something like this:
mysql_config
Usage: /usr/bin/mysql_config [OPTIONS]
Compiler: GNU 6.3.0
Options:
--cflags [-I/usr/include/mysql ]
--cxxflags [-I/usr/include/mysql ]
--include [-I/usr/include/mysql]
--libs [-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -ldl]
--libs_r [-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -ldl]
--plugindir [/usr/lib/mysql/plugin]
--socket [/var/run/mysqld/mysqld.sock]
--port [0]
--version [5.7.18]
--libmysqld-libs [-L/usr/lib/x86_64-linux-gnu -lmysqld -lpthread -lz -lm -lrt -latomic -lcrypt -ldl -laio -llz4 -lnuma]
--variable=VAR VAR is one of:
pkgincludedir [/usr/include/mysql]
pkglibdir [/usr/lib/x86_64-linux-gnu]
plugindir [/usr/lib/mysql/plugin]
Ideally it should contain libmysqld-libs option. If it is not there, as it was not there in my case, you can assume that your mysql is broken.
In this case you can write this configuration to config file directly
- [Django]-Django Registration Number of users logged in
- [Django]-Django application deployed at suburl, redirect to home page after login
- [Django]-Where to put Django comments moderation code?
- [Django]-Exception while installing packages in Python
0π
Not sure if it useful. But it help me to solve the problem.
apt-get install build-essential zlib1g zlib1g-dev zlibc libxml2 libxml2-dev
- [Django]-Django url rewrite without redirect
- [Django]-Django static templatetag not displaying SVG
- [Django]-Model inheritance in django-nonrel on app engine
- [Django]-Redirect realtime common line output to Django HttpResponse
0π
For completeness sake, on Debian Stretch the pkg is now called default-libmysqlclient-dev.
sudo apt-get install default-libmysqlclient-dev
- [Django]-Django Hierarchy Permissions
- [Django]-Django Tastypie User Objects Only Authorization
- [Django]-Django API Framework β Nested Models View
- [Django]-Django: Using DataTables
- [Django]-How to use SearchHeadline with SearchVector on multiple fields
0π
I run the following commands and it worked smooth in Ubuntu 17.10
sudo apt-get install libmysqlclient-dev
pip3 install mysqlclient
- [Django]-Crispy-forms InlineRadios don't show my model state
- [Django]-Django makemigrations No changes detected in app
- [Django]-OAuth authentication fails for google data APIs for hosted domains using gdata