In this MariaDB tutorial, we will learn, how to install MariaDB in windows, Linux, and Ubuntu. Also, we will see how to uninstall MariaDB step by step on different Operating Systems like Windows, Linus, Ubuntu, etc.
Additionally, we will cover the following topics
- Downloading MariaDB
- MariaDB Installation and Configuration on Windows
- MariaDB installation on Linux step by step
- MariaDB installation in Ubuntu
- Uninstall MariaDB from Windows
- Uninstall MariaDB from Linux
- Uninstall MariaDB from Ubuntu
- MariaDB Installation error setup wizard ended prematurely error
Downloading MariaDB
To download MariaDB, go to the official page and select the latest version to download: Download MariaDB
The MariaDB software is managed by the MariaDB Foundation whose headquarters is in Finland and the United States Of America.
MariaDB Installation and Configuration on Windows
Let us see step by step how to start the installation of MariaDB in Windows operating system.
To start the installation of MariaDB on Windows, you need to follow these steps:
Step 1 – Double-click on the installer to start the installation process.

Step 2 – Accept the End-User Agreement and click the Next button.

Step 3 – Select the way we want to start the installation of the features and choose the directory that stores the MariaDB files and click on the Next button. The default location on windows is C:\Program Files MariaDB 10.6\

Step 4 – Create a password for the Root user account. You will later use this password to access MariaDB Server. The root user is the default user which has all the privileges
If you don’t want the root user to log in from remote machines, uncheck the Enable access from remote machines for 'root' user
The Use UTF8 as default server's character set
the option allows us for using the UTF8 character set while creating new databases and tables.
Once you select all the options, click on the Next button to go to the next step.

Step 5 – In this step:
Firstly, install MariaDB as a service by clicking on Install as service
and it will allow you to change the name of the service.
Secondly, you need to configure the port for the MariaDB. By default, it uses 3306 but you can change the port if you want.
Thirdly, specify the parameters InnoDB engine including Buffer pool size and Page size. 16KB is suitable for most of the databases.
Finally, click on the Next button to go on to the next step.

Step 6 – Click Install to start the installation.

It may take a few minutes to complete depending upon the system.

Step 7 – Click on the Finish button to complete the MariaDB installation.

Now, you can find MariaDB tools in the Start menu.
This is how to start the installation of MariaDB on windows OS.
Read How to Create Table in MariaDB
MariaDB installation on Linux step by step
Now, let us see how to start the installation of MariaDB on Linux.
To start the installation of MariaDB on Linux, you need to follow these steps:
Step 1 – Check the Linux version by using the below command before we download MariaDB.
ALTER TABLE gadgets
ALTER COLUMN location TYPE VARCHAR,
ALTER COLUMN description TYPE VARCHAR;
Step 2 – Create or edit already existing MariaDB.repo using the below command.
# vi /etc/yum.repos.d/MariaDB.repo
After running this command, we will see whether there is any content inside that repo if there is no content in it. Then, you need to copy the below commands in that file.
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Save the file with:wq!
Step 3 – Now, install the MariaDB Server and MariaDB Client using this command.
# sudo yum install MariaDB-server MariaDB-client
This may take time depending upon the machine.
After the completion of the installation, if you want to check whether the service has started or not. To check this you need to use #cd/var
and #cd/lib
commands. If mysql
is present then the installation went right.
Step 4 – To start the MariaDB service, use the below command.
# sudo systemctl start mysql
Now you can use the below command to see whether the service has started or not.
# sudo systemctl status mysql
Step 5 – Run the secure installation by using the below command to configure the root password and other features. Then, you can set a new root password and other features.
# sudo mysql_secure_installation
Step 6 – Now, login to MariaDB using Root using the below command.
# mysql -uroot -p
The installation of MariaDB in Linux has been completed.
MariaDB installation in Ubuntu
Let us see, how to start the installation of MariaDB in Ubuntu.
There are two ways in Ubuntu by which we can install MariaDB
- Install MariaDB using Ubuntu Repository
- Install MariaDB using MariaDB Repository
Installing MariaDB using Ubuntu Repository
For installing MariaDB Server in Ubuntu using the Ubuntu repository, follow the given steps provided below:
Step 1 – In this, we need the package index to be updated. For that, you need to run the statement.
sudo apt update
Your packages are updated after executing this command.
Step 2 – After the list of packages has been up-to-date, you should now start installing MariaDB by running the statement.
sudo apt install mariadb-server
We may be asked to enter the credentials for the user.
Step 3 – Service of MariaDB will automatically start. However, we can check the status after executing the below query.
sudo systemctl status mariadb
The status will be running and active.
To check the MariaDB version that is installed, you can execute the below statement.
mysql -V
The output of the statement will be the MariaDB version installed and it is the confirmation that we have installed MariaDB successfully on Ubuntu.
Install MariaDB using MariaDB Repository
MariaDB repositories have the latest MariaDB version. Before initiating the process of installation, we must have a look at the MariaDB official website and verify the latest MariaDB version.
To start the installation of MariaDB in Ubuntu using the MariaDB repository, follow the steps provided below:
Step I – In this step, you need to run the below command for adding the GPG key of MariaDB with Ubuntu.
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Step II – After the key is imported, execute the statement for adding the repository of MariaDB.
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirrors.accretive-networks.net/mariadb/repo/10.3/ubuntu bionic main'
If we encounter an error stating “add-apt-repository command not found”, we need to start the installation of the “software-properties-common” packages.
Step III – Before the installation of any other packages present in the repositories of MariaDB, we should keep the package lists updated. For this, you need to execute the below statement.
sudo apt update
Step IV – After adding the repository, we need to execute the below command to start the installation of the package of MariaDB.
sudo apt install mariadb-server
Step V – Although, the service automatically starts, to check the status, execute the below statement.
sudo systemctl status mariadb
The status will be running and active.
Step VI – To verify the MariaDB version installed on our PC, we need to run the below command and it will also ensure that the installation is completed successfully.
mysql -V
Read How to Grant User Access to a MariaDB Database
Uninstall MariaDB from Windows
There are several methods to uninstall MariaDB from Windows. Some of them are mentioned below.
Method 1
When any new piece of program is installed on your computer, that program is added to the list of Programs and Features. You can uninstall the program from that list. To uninstall MariaDB from your computer follow the steps
Step 1 – Press the Windows and X keys together to open a menu and click on Apps and Features at the top of the menu.

Step 2 – Then, Setting Window will open, and in that window, you need to click on Programs and Features present in the top-right corner.

Step 3 – You will see the list of programs installed on your computer. You need to select MariaDB and then click on Uninstall Button.

Method 2
In this method, you only need to go to the installation file of MariaDB and find uninstall.exe or unins000.exe. Then, you need to double-click on it and follow the wizard to uninstall MariaDB.
Method 3
In this method, you need not uninstall MariaDB manually as it does not remove it completely. So, it’s recommended that you uninstall MariaDB with a trusted third-party uninstaller that can identify and remove all files of MariaDB.
Note – If nothing works, then we can uninstall MariaDB via System restore by choosing a Restore point. But, you need to backup your data that was created or installed on your computer after the installation of MariaDB.
Read How to Create Database in MariaDB
Uninstalling MariaDB in Linux
Step 1 – For uninstallation of MariaDB in Linux CentOS, you need to run the below command
sudo yum remove MariaDB-server MariaDB-client
When you don’t have a MariaDB client, then you run the above command without MariaDB-client.
Step 2 – The process of uninstallation does not erase the data directory /var/lib/mysql. For future use, we can leave it for further use. Otherwise, we can remove it by using the below command.
sudo rm -r /var/lib/mysql
Uninstall MariaDB from Ubuntu
To delete MariaDB completely from your computer, you need to follow these steps.
Step 1 – Before the process of uninstallation, you need to see the status of MariaDB and the version of MariaDB by running the statement.
systemctl status mariadb
Step 2 – In this step, you need to run the purge command to erase the package of MariaDB.
apt purge "mariadb*" -y
Step 3 – Now, run the autoremove
command to completely delete the configuration files.
apt autoremove -y
Step 4 – To verify that the uninstallation is successfully completed, you need to check the status of the MariaDB service.
systemctl status mariadb
The output of this command will ensure you the uninstallation of the MariaDB service.
Read: MariaDB Not Between
MariaDB Installation error setup wizard ended prematurely error
Here we will illustrate 2 methods to resolve the MariaDB Installation error setup wizard ended prematurely error.
First method
This kind of problem occurs in the system while installing the MariaDB application because some of the libraries don’t exist in the system that MariaDB uses. So before installing MariaDB make sure that the Microsoft Visual C++ 2015-2019 Redistributable existing
in your system.
- If not, download the setup file from Microsoft’s official website. And install it before installing the MariaDB.

- Go to the installed app section of your windows system, check that the above application is installed or not as shown in the below images.

Now follow the below steps to install the MariaDB.
- First double-click on the MariaDB setup to begin the installation and as a window appear for installation click on
Next
button.

- Accept the
End-User License Agreement
by checking the marked box and clicking onNext
button.

- Leave everything as default and click on
Next
button.

- Now as a window appear for
User setting
, then enter the new password for the user in the box in front of the fieldNew root password
. - And again enter the same password to confirm that password in front of the field
Confirm
. Click onNext
button to proceed with the installation.

- A window
Database setting
appears to set the service name and port. Make changes according to your need otherwise leave it as default and click on Next the button.

- Click on
Install
button to install the MariaDB in the below picture.

- Click on
Finish
the button to complete the installation.

Second method
If the above steps don’t work then follow these steps.
- Press
Windows key + R
and type the below command in that box and hit Enter.
services.msc

- Then
Service
a window appears that contain all the running services on your system, then scroll down and search for the service nameWindows Installer
and click onStart
button to start this service.

- After starting the service
Windows Installer
, open thecommand-line
as an administrator by clicking onRun as administrator
.

- As the command-line opens, type the below command one by one and hit the
Enter
a button from your keyboard.
msiexec /unreg
msiexec /regserver

- After running the above command in the command line, restart your computer. Then again open the command-line as an administrator by clicking on
Run as administrator
. Type the below command.
regsvr32 vbscript.dll

After running the above steps, Now install the MariaDB on your system.
This is how to solve the MariaDB installation error.
You may like the following MariaDB tutorials:
In this tutorial, we have learned about the installation and uninstallation of MariaDB. Additionally, we have covered the following topics
- Downloading MariaDB
- MariaDB Installation and Configuration on Windows
- MariaDB installation on Linux step by step
- MariaDB installation in Ubuntu
- Uninstall MariaDB from Windows
- Uninstall MariaDB from Linux
- Uninstall MariaDB from Ubuntu
- MariaDB Installation error setup wizard ended prematurely first method
- MariaDB Installation error setup wizard ended prematurely second method
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.