Bobcares

OSError: mysql_config not found

by | May 10, 2022

“OSError: mysql_config not found” is an error we usually get when installing the python mysqlclient module using pip. We are here to resolve the issue.

As part of our Server administration services, Bobcares provides answers to any questions.

Let’s take a closer look at how our expert Support team helped a customer fix this problem.

OSError: mysql_config not found

We received the error “OSError: mysql config not found” when installing the python mysqlclient module with pip.

mySQLdb is a Python interface to MySQL, but it is not MySQL. Also, mySQLdb appears to require the command’mysql_config,’ so we’ll need to install that first.

Most Linux distributions come with Mysql pre-installed. For example, in Debian / Ubuntu, we can use the command to install mysql:-
sudo apt-get install mysql

mysql-config is in a separate package that we can install from:
sudo apt-get install libmysqlclient-dev

There are three ways to install Python drivers/connectors for working with MySQL databases.

MySQL-python
Type the following command to install the MySQL-python package:
pip install MySQL-python

mysql-connector-python
Type the following command to install the mysql-connector-python package:
pip install mysql-connector-python

pymysql
Type the following command to install the pymysql package:
pip install pymysql

Easy solution for the OSError: mysql_config not found

 

Firstly, we must install the apt-get package.
sudo apt-get install mysql-server
sudo apt-get install libmysqlclient-dev
sudo apt-get install libmariadbclient-dev

Then, we need to install pip package
pip install mysqlclient

Then we’re ready to install any package that has a problem with
pip install the-package-name

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our Skilled engineers demonstrated how to resolve the error:“OSError: mysql_config not found”

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.