close

[Solved] mysql_config not found when installing mysqldb python interface

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error mysql_config not found when installing mysqldb python interface in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How mysql_config not found when installing mysqldb python interface Error Occurs?

Today I get the following error mysql_config not found when installing mysqldb python interface in python.

How To Solve mysql_config not found when installing mysqldb python interface Error ?

  1. How To Solve mysql_config not found when installing mysqldb python interface Error ?

    To Solve mysql_config not found when installing mysqldb python interface Error The MySQL-python package is using the mysql_config command to learn about the mysql configuration on your host.

  2. mysql_config not found when installing mysqldb python interface

Solution 1

mySQLdb is a python interface for mysql, but it is not mysql itself. And apparently mySQLdb needs the command ‘mysql_config’, so you need to install that first.

Can you confirm that you did or did not install mysql itself, by running “mysql” from the shell? That should give you a response other than “mysql: command not found”.

Which linux distribution are you using? Mysql is pre-packaged for most linux distributions. For example, for debian / ubuntu, installing mysql is as easy as

sudo apt-get install mysql-server

mysql-config is in a different package, which can be installed from (again, assuming debian / ubuntu):

sudo apt-get install libmysqlclient-dev

if you are using mariadb, the drop in replacement for mysql, then run

sudo apt-get install libmariadbclient-dev

Solution 2

The MySQL-python package is using the mysql_config command to learn about the mysql configuration on your host. Your host does not have the mysql_config command.

The MySQL development libraries package (MySQL-devel-xxx) from dev.mysql.com provides this command and the libraries needed by the MySQL-python package. The MySQL-devel packages are found in the download – community server area. The MySQL development library package names start with MySQL-devel and vary based MySQL version and linux platform (e.g. MySQL-devel-5.5.24-1.linux2.6.x86_64.rpm.)

Note that you do not need to install mysql server.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read