MySQL Defaults
Metapackage collection providing default implementations for MySQL/MariaDB client, server, and development libraries in Kali Linux. Ensures compatibility by depending on the system's default MySQL or MariaDB versions.
Description
The mysql-defaults tool encompasses several metapackages that simplify the installation of MySQL or MariaDB components by automatically selecting the system's default implementation. These packages are essential for developers and administrators needing reliable database access without specifying underlying engines like MySQL or MariaDB. Each metapackage pulls in the appropriate dependencies, ensuring binaries link correctly to either libmysqlclient or libmariadbclient based on the current default.
Use cases include building database-dependent applications, setting up client tools for querying, or configuring server infrastructure for system databases. For instance, default-libmysqlclient-dev is crucial for compiling software that interfaces with MySQL APIs, while default-mysql-server handles full server setup including system database initialization. The packages promote ease of use, speed, and robustness in multi-user, multi-threaded SQL environments.
Common files like /etc/mysql/my.cnf are provided by mysql-common, shared across all components. This setup is particularly useful in Kali Linux for penetration testing scenarios involving database enumeration and SQL injection, as referenced in related OffSec training.
How It Works
These metapackages act as dependency proxies, resolving to either MySQL or MariaDB based on Debian/Ubuntu defaults defined in the package configuration. When installing, dpkg pulls in the active implementation (e.g., mariadb-client-compat for clients). For development, linking with -lmysqlclient produces binaries dependent on libmysqlclient.so.X or libmariadbclient.so.X, with dpkg-shlibdeps generating correct runtime dependencies. Server metapackages include infrastructure for system database setup but exclude it in core variants.
Installation
sudo apt install default-libmysqlclient-devExamples
sudo apt install default-libmysqlclient-devsudo apt install default-mysql-clientsudo apt install default-mysql-client-coresudo apt install default-mysql-serversudo apt install default-mysql-server-coresudo apt install mysql-common