"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to Fix \"mysql_config not found\" Error When Installing MySQL-python on Ubuntu/Linux?

How to Fix \"mysql_config not found\" Error When Installing MySQL-python on Ubuntu/Linux?

Posted on 2025-04-15
Browse:749

How to Fix \

MySQL-python Installation Error: "mysql_config not found"

Attempting to install MySQL-python on Ubuntu/Linux Box may encounter an error message indicating that "mysql_config: not found." This error arises due to a missing MySQL development library.

To resolve this issue, it is recommended to utilize the distribution's repository on Ubuntu. Install python-mysqldb using the following command:

sudo apt-get install python-mysqldb

If installing using pip is desired, consider the following steps:

  1. Ensure that the prerequisite packages are installed:
sudo apt-get install build-essential python-dev libmysqlclient-dev
  1. Uninstall any existing MySQL-python installation:
sudo pip uninstall MySQL-python
  1. Try installing MySQL-python again using pip:
sudo pip install MySQL-python
  1. Consult this comprehensive installation guide for further details: http://mysql-python.blogspot.no/2012/11/is-mysqldb-hard-to-install.html
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3