This tutorial is going to explain how to install MariaDB on your Bitnami virtual machine. Bitnami stacks come packaged with MySQL by default so in case you wanted to use MariaDB whether for work or play, hopefully this tutorial will help you.
Difficulty Level – Intermediate
If you are not familiar with using a command line tool such as PuTTY or Terminal, then this may prove to be a bit of a challenge, but I have created the instructions to be as easy as possible to follow.
- You have the Bitnami virtual machine downloaded to your local hard drive somewhere. (We’re going to use the Bitnami Drupal virtual machine for this tutorial.)
- You have either Oracle VirtualBox or VMware Player ready to read the virtual machine. (You can use whatever virtualization software you want, but for this tutorial I will be using VMware Player.)
- You have installed the following on the virtual machine before proceeding with the instructions:
- Vim (or some other text editor)
- SSH is running on the virtual machine to allow you to connect to the virtual machine (vm).
- IMPORTANT! You must have allocated at least 1 GB of ram for the vm in your virtualization software.
- Open up PuTTY (or your command line tool of choice) and connect to your vm.
- Type in the following commands to remove the directory where Bitnami has their install of MySQL:
sudo -rm -R /opt/bitnami/mysql
This will remove Bitnami’s MySQL directory, essentially removing their installation of it.
- You should still be in the
/home/bitnamidirectory so type in the following commands to bring up the bashrc file in Vim:
sudo vim .bashrc
- Press the “Insert” key on your keyboard to set Vim into edit mode.
- Search for the following path:
/opt/bitnami/mysql/bin:and remove it:
- Press the escape key (Esc) to exit out of Vim’s edit mode.
- Hold down Shift and press the colon key (:).
- Now type
wqthen press the “Enter” key to save and quit out of Vim.
- Then once you’re back on the command line, type in the following command:
sudo apt-get install python-software-properties
- Once the installation finishes, type in the following commands (careful if you’re copying and pasting):
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
- Then type in the following command to add the appropriate repository to get MariaDB:
sudo add-apt-repository 'deb http://ftp.utexas.edu/mariadb/repo/5.5/ubuntu precise main'
- Then type in the following command to update the repositories:
sudo apt-get update
- Once the repositories finish updating, type the following commands to install the MariaDB server:
sudo apt-get install mariadb-server
- You’ll be prompted with the following screen to enter a password for the MariaDB root user, so proceed as instructed:
- After setting the “root” password and the installation finishes, check to see if you’re able to log into the database service by typing in the following:
mysql -u root -p
When prompted for your password, type it in and you should be able to get into the MariaDB console.
- If MariaDB server fails to start up when installing, restart your virtual machine, then type in the following command:
sudo apt-get install --f
This will attempt to install any missing dependencies and components.