The MariaDB and MySQL clients are command-line tools that allow users to manage database servers remotely. These tools enable developers and administrators to run queries, update data, and administer databases from a local machine. No server installation is required on the local machine to interact with the remote database servers.
Ubuntu provides packages for both MySQL and MariaDB clients in its default repositories. You can install either or both, depending on your needs. The clients operate independently, meaning both can be installed and used on the same machine without causing conflicts.
This guide will show you how to install the MariaDB or MySQL client on an Ubuntu system. Follow the instructions to get the client you need up and running to connect to your database server.
Steps to install MariaDB or MySQL client on Ubuntu:
- Launch the terminal on your Ubuntu system.
- Update the system's package list.
$ sudo apt update
- Install the MySQL client package.
$ sudo apt install mysql-client
To install the MariaDB client instead, replace mysql-client with mariadb-client.
- Verify the installation by checking the client version.
$ mysql --version mysql Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)
If you installed the MariaDB client, the output should look like this:
mariadb Ver 15.1 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
- Connect to a remote database server using the client.
$ mysql -h [remote-host] -u [username] -p
Replace [remote-host] with the IP address or hostname of your database server, and [username] with your database user. You will be prompted to enter the password.
- To exit the client, type exit or press Ctrl + D.
This guide is tested on Ubuntu:
Version | Code Name |
---|---|
22.04 LTS | Jammy Jellyfish |
23.10 | Mantic Minotaur |
24.04 LTS | Noble Numbat |
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.