mysql_config command not found

In this troubleshooting guide we learn how to fix mysql_config command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

mysql_config: command not found

or when using sudo you get the following error message

sudo: mysql_config: command not found

Solutions to mysql_config: command not found

How To Fix mysql_config: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu mysql_config is provided by libmariadb-dev-compat package.

libmariadb-dev-compat is:

MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and ease of use.

This package includes compatibility symlinks to allow sources expecting the MySQL client libraries to be built against MariaDB Connector/C.

To fix this problem, we can install more using the command below.

sudo apt-get -y install libmariadb-dev-compat

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install libmariadb-dev-compat.

sudo apt -y install libmariadb-dev-compat

Or if you have aptitude installed you can use the following command.

sudo aptitude install libmariadb-dev-compat

Summary

In this tutorial we learn how to fix mysql_config command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.