In the previous post, we checked out the method for installing MariaDB on Ubuntu 22.04. Today, we will move one step ahead and discuss different approaches for checking MariaDB’s version running on Ubuntu 22.04.
When working with a database management system like MariaDB, it is important to know which version you are using. This information can be useful for troubleshooting issues, determining whether your system is up-to-date, or ensuring compatibility with other software.
The contents of this post are:
- Method 1: Checking MariaDB Version Using Ubuntu 22.04’s Terminal
- Method 2: Checking MariaDB Version on Ubuntu 22.04 Using MariaDB Shell
- How to Upgrade MariaDB on Ubuntu 22.04?
Method 1: Checking MariaDB Version Using Ubuntu 22.04’s Terminal
In this method, we will specifically use Ubuntu’s terminal for checking the MariaDB version installed on our system.
Step 1: Open Ubuntu’s Terminal
To open Ubuntu 22.04’s terminal, navigate to the “Application Menu” button:
Then, search for the “Terminal” in the search bar or simply hit “CTRL+ALT+T” to launch the terminal:
Step 2: Check the MariaDB version
Lastly, check the MariaDB version by executing the command below:
sudo mysql --version
It can be observed that MariaDB version 10.6.12 has been installed on Ubuntu 22.04.
Method 2: Checking MariaDB Version on Ubuntu 22.04 Using MariaDB Shell
MariaDB shell is a command-line interface used to manage MariaDB databases, offering advanced features and scripting capabilities.
In this method, we will utilize the MariaDB shell to check out the installed version of MariaDB on our Ubuntu 22.04.
Step 1: Connecting to MariaDB shell
Open up the terminal and write the mentioned command for connecting to the MariaDB shell:
sudo mysql -u root -p
Step 2: Check the MariaDB version
Utilize the mentioned command for checking out the MariaDB version:
Our Ubuntu 22.04 system has MariaDB version 10.6.12 installed.
How to Upgrade MariaDB on Ubuntu 22.04?
For upgrading MariaDB on Ubuntu 22.04, follow the series of steps mentioned below.
Step 1: Backup all databases
To upgrade MariaDB, you need to back up all databases. To do so, run this command:
sudo mysqldump -u root -p --all-databases > backup.sql
Step 2: Adding the MariaDB repository
MariaDB repository can be added by utilizing the mentioned commands:
sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.6/ubuntu focal main'
Step 3: Upgrade MariaDB
Before proceeding with the MariaDB upgrade process, run the following command:
sudo apt-get update
As the next step, upgrade MariaDB:
sudo apt-get upgrade mariadb-server
Wait till the MariaDB upgrade process gets completed:
In our case, MariaDB already had the newest version.
To check the MariaDB version installed on your Ubuntu 22.04, you can utilize the Ubuntu terminal and MariaDB shell as well. For implementing the first method, open up Ubuntu’s terminal and execute the “sudo mysql –version” command. You can also utilize the second method to get your purpose done. For this, open up the MariaDB shell using the “sudo mysql -u root -p” command. Then, run the “SELECT VERSION();” command.
In this post, we have provided you with the different approaches for checking the MariaDB version on your Ubuntu 22.04. This post also explained the method for upgrading MariaDB.
Follow Linux Genie to remain up-to-date related to the latest trends and technologies!