Bitnami Tutorial – Installing MariaDB over MySQL on a Bitnami virtual machine

October 14, 2014

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
  • 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.


  1. Open up PuTTY (or your command line tool of choice) and connect to your vm.
  2. 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.

  1. You should still be in the /home/bitnami directory so type in the following commands to bring up the bashrc file in Vim:
sudo vim .bashrc
  1. Press the “Insert” key on your keyboard to set Vim into edit mode.
  2. Search for the following path: /opt/bitnami/mysql/bin: and remove it:
  1. Press the escape key (Esc) to exit out of Vim’s edit mode.
  2. Hold down Shift and press the colon key (:).
  3. Now type wq then press the “Enter” key to save and quit out of Vim.
  4. Then once you’re back on the command line, type in the following command:
sudo apt-get install python-software-properties
  1. 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
  1. 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'
  1. Then type in the following command to update the repositories: 
sudo apt-get update
  1. Once the repositories finish updating, type the following commands to install the MariaDB server: 
sudo apt-get install mariadb-server
  1. You’ll be prompted with the following screen to enter a password for the MariaDB root user, so proceed as instructed:
  1. 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.

Troubleshooting Tips

  • 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.

You Might Also Like