Home > Database > Mysql Tutorial > body text

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

Susan Sarandon
Release: 2024-11-03 08:08:02
Original
780 people have browsed it

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
Copy after login

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
Copy after login
  1. Uninstall any existing MySQL-python installation:
sudo pip uninstall MySQL-python
Copy after login
  1. Try installing MySQL-python again using pip:
sudo pip install MySQL-python
Copy after login
  1. Consult this comprehensive installation guide for further details: http://mysql-python.blogspot.no/2012/11/is-mysqldb-hard-to-install.html

The above is the detailed content of How to Fix \'mysql_config not found\' Error When Installing MySQL-python on Ubuntu/Linux?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template