- These instructions are intended for installing MariaDB 5.5 on a single Ubuntu 14.04 LTS node (without MySQL already installed).
- I’ll be working from a Liquid Web Self Managed Ubuntu 14.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 How to Add a User and Grant Root Privileges on Ubuntu 14.04.
Step #1: Add the MariaDB RepositoryThe software-properties-common package should already be installed, but just in case:
sudo apt-get install software-properties-commonTo 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 0xcbcb082a1bb943dbThen 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 MariaDBAt this point, installing MariaDB is as simple as running just one command:
sudo apt-get install mariadb-serverYou may receive the following prompt or something similar: After this operation, 116 MB of additional disk space will be used. Do you want to continue? [Y/n] Enter Y to continue. Next, you’ll be asked: New password for the MariaDB “root” user: 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: Repeat password for the MariaDB “root” user: 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 UseNow we’ll instruct MariaDB to create its database directory structure:
sudo mysql_install_dbStart MariaDB:
sudo service mysql startAnd now let’s secure MariaDB by removing the test databases and anonymous user created by default:
sudo mysql_secure_installationYou’ll be prompted to enter your current password. Enter the root MariaDB password set during installation: Enter current password for root (enter for none): Then, assuming you set a strong root password, go ahead and enter n at the following prompt: Change the root password? [Y/n] n Remove anonymous users, Y: Remove anonymous users? [Y/n] Y Disallow root logins remotely, Y: Disallow root login remotely? [Y/n] Y Remove test database and access to it, Y: Remove test database and access to it? [Y/n] Y And reload privilege tables, Y: Reload privilege tables now? [Y/n] Y
Step 4: Verify MariaDB InstallationYou can check the version of the MariaDB installation with the following command:
mysql -VEnter the MariaDB command client:
mysql -pYou’ll be asked for the root password for the MariaDB server, which was set earlier in this tutorial: Enter password: And then you should be greeted with the following:
Welcome to the MariaDB monitor. Commands end with ; or \g.
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:
sudo service mysql stopStart MariaDB:
sudo service mysql startTo check the status of MariaDB:
sudo service mysql statusRestart MariaDB:
sudo service mysql restartWhatever database you choose to use, we’ll be able to provide info to ensure you have the latest and most current data possible. Should you need assistance setting up, modifying or utilizing your database, don’t hesitate to contact our support department for more answers! You can reach us via our toll free number at 1-800-580-4985, or, use our International number at 517.322.0434. You can also open a ticket with us using the firstname.lastname@example.org email or, open a ticket from your Manage interface. Lastly, there’s always our chat option if you need quick info on smaller issues. Whatever means you choose, do not hesitate to contact us, as we are always standing by to offer our assistance and support! Thanks for hosting with Liquidweb!