command not found: mysql_config
时间: 2023-10-07 12:07:55 浏览: 144
这个错误通常是由于没有安装 `mysql-devel` 导致的。您可以通过以下命令在 CentOS 或者 RedHat 系统中安装:
```
sudo yum install mysql-devel
```
如果您使用的是 Ubuntu 或者 Debian 系统,则可以使用以下命令安装:
```
sudo apt-get install libmysqlclient-dev
```
安装成功后再次运行您的命令即可。
相关问题
/bin/sh: mysql_config: command not found /bin/sh: mariadb_config: command not found /bin/sh: mysql_config: command not found
These errors indicate that the system is unable to locate the "mysql_config" or "mariadb_config" command. This could be due to a missing package or an incorrect installation.
To resolve this issue, you can try the following steps:
1. Install the MySQL or MariaDB development package by running the following command:
For MySQL:
```
sudo apt-get install libmysqlclient-dev
```
For MariaDB:
```
sudo apt-get install libmariadbclient-dev
```
2. If the above command does not work, you can try locating the "mysql_config" or "mariadb_config" command manually by running the following command:
```
sudo find / -name mysql_config
```
If the command is found, update the PATH environment variable to include the directory where the command is located. For example, if the command is located in "/usr/local/mysql/bin", you can add the following line to your .bashrc or .bash_profile file:
```
export PATH=$PATH:/usr/local/mysql/bin
```
3. If the above steps do not work, you may need to reinstall MySQL or MariaDB and ensure that the required development packages are installed.
mysql_config not found
If you are on a Linux-based system, you can try installing the mysql-devel package using the package manager of your distribution. For example, on Ubuntu or Debian, you can use the following command:
```
sudo apt-get install libmysqlclient-dev
```
If you are on a macOS system, you may need to install the MySQL client tools separately. You can download the MySQL Community Server from the official website and install it on your system. After installing, you should be able to find the mysql_config file in the bin directory of the MySQL installation.
If you are still having trouble finding the mysql_config file, you can try searching for it using the following command:
```
sudo find / -name mysql_config
```
This will search for the mysql_config file in all directories on your system. Once you have located the file, you can add its directory to your PATH environment variable so that it can be found by other programs. For example, if the mysql_config file is located in /usr/local/mysql/bin, you can add the following line to your .bashrc file:
```
export PATH=$PATH:/usr/local/mysql/bin
```
Remember to replace /usr/local/mysql/bin with the actual directory where mysql_config is located on your system.
阅读全文