How to Install MariaDB 5.5 on Ubuntu 17.04 LTS
MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL), XtraDB (drop-in replacement for InnoDB), and OQGRAPH.
Pre-Flight Check
- These instructions are intended for installing MariaDB 5.5 on a single Ubuntu 17.04 LTS(without MySQL already installed).
- I’ll be working from a Liquid Web Self Managed Ubuntu 17.04 LTS server, and I’ll be logged in as a non-root user, but with sudo access. For information on giving a user sudo access visit our page on .
Step #1: Add the MariaDB Repository
The software-properties-common package should already be installed, but just in case:
sudo apt-get install software-properties-common
To find which repo you should use with the MariaDB repository generator. We’re going to add the Ubuntu 14.04 “trusty” MariaDB 5.5 repository.
We’ll import the MariaDB public key used by the package management system:
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
Then we’ll add the MariaDB repository:
sudo add-apt-repository 'deb http://mirror.jmu.edu/pub/mariadb/repo/5.5/ubuntu trusty main'
Now reload the package database:
sudo apt-get update
Step #2: Install MariaDB
At this point, installing MariaDB is as simple as running just one command:
sudo apt-get install mariadb-server
You may receive the following prompt or something similar:
Do you want to continue? [Y/n]
Enter Y to continue.
Next you’ll be asked:
This is an administrative account in MariaDB with elevated privileges; enter a strong password.
Then you’ll be asked to verify the root MariaDB password:
That’s it! Your basic MariaDB installation is now complete!
Be sure to stop MariaDB before proceeding to the next step:
sudo service mysql stop
Step 3: Configure and Secure MariaDB for Use
Now we’ll instruct MariaDB to create its database directory structure:
sudo mysql_install_db
Start MariaDB:
sudo service mysql start
And now let’s secure MariaDB by removing the test databases and anonymous user created by default:
sudo mysql_secure_installation
You’ll be prompted to enter your current password. Enter the root MariaDB password set during installation:
Then, assuming you set a strong root password, go ahead and enter n at the following prompt:
Remove anonymous users, Y:
Disallow root logins remotely, Y:
Remove test database and access to it, Y:
And reload privilege tables, Y:
Step 4: Verify MariaDB Installation
You can check the version of the MariaDB installation with the following command:
mysql -V
Enter the MariaDB command client:
mysql -p
You’ll be asked for the root password for the MariaDB server, which was set earlier in this tutorial:
And then you should be greeted with the following:
Your MariaDB connection id is 34
Server version: 5.5.41-MariaDB-1~trusty-log mariadb.org binary distribution
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]>
Exit the command line with the following command:
exit
To stop MariaDB:
sudo service mysql stop
To start MariaDB:
sudo service mysql start
To check the status of MariaDB:
sudo service mysql status
To restart MariaDB:
sudo service mysql restart
Comments
Post a Comment