Home  >  Blog  >   OpenStack  > 

How to Configure Database Services – OpenStack

Rating: 4
  1. Share:
OpenStack Articles

Configure Database Services

Each of the core OpenStack services (Compute, Identity, Networking, Block Storage) stores state and configuration information in databases. The Database service provides a scalable and reliable Cloud Database-as-a-Service functionality for both relational and non-relational database engines. Users can quickly and easily use database features without the burden of handling complex administrative tasks.

If you would like to become an OpenStack  Certified professional, then visit Mindmajix - A Global online training platform:" OpenStack Certification Training Course ". This course will help you to achieve excellence in this domain. 

OpenStack supports a number of database backends—an internal SQLite database (the default), MySQL, and Postgres.  Many OpenStack services maintain a database to keep track of critical resources, usage, and other information. By default, individual SQLite databases are specified for this purpose and are useful for the single-node configuration. For multi-node configurations, a MySQL database is recommended for storing this information.

SQLite is used only for testing and is not supported in a nt, whereas MySQL or Postgres usage is down to the experience of the database staff. For the remaining fields of this tutorial, we shall use MySQL.

Setting up MySQL is easy and allows you to grow this environment as you progress through the chapters of this tutorial.

Getting started

We will configure our OpenStack Controller services to use MySQL as the database backend, so this needs to be installed prior to configuring our OpenStack Compute environment.


Refer to the recipe Installing OpenStack Identity Service in Chapter 1, and also Keystone OpenStack Identity Service, for instructions on setting up MySQL.
If you are not already on the OpenStack Controller, ssh into this using Vagrant as follows:

  • vagrant ssh controller

MindMajix Youtube Channel

How to achieve it…

To use OpenStack Compute (Nova), we first need to assure that our backend database has been equipped with the required nova database. To create this, follow the steps below on our controller host running MySQL:

1. With MySQL running, we configure an appropriate database user, called Nova, and privileges for use by OpenStack Compute:

mysql -uroot -p$MYSQL_ROOT_PASS -e ‘CREATE DATABASE nova;’
mysql -uroot -p${MYSQL_ROOT_PASSWORD}
mysql -uroot -p${MYSQL_ROOT_PASSWORD}

2. We now simply refer our MySQL server in our /etc/nova/nova.conf file to use MySQL by adding in the sql_connection flag:


Explore OpenStack Sample Resumes! Download & Edit, Get Noticed by Top Employers!  Download Now!

How it works…

MySQL is an essential service to OpenStack as a number of services rely on it. Configuring MySQL appropriately assures that your servers operate smoothly. We added a database called Nova that will eventually be populated by tables and data from the OpenStack Compute services and grant all privileges to the Nova database user so that the user can use it.
Finally, we configured our OpenStack Compute installation to specify these details so that they can use the Nova database.

Related Pages:
OpenStack Tutorial

Interview Questions:
OpenStack Interview Questions


Join our newsletter

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
OpenStack TrainingDec 06 to Dec 21
OpenStack TrainingDec 10 to Dec 25
OpenStack TrainingDec 13 to Dec 28
OpenStack TrainingDec 17 to Jan 01
Last updated: 04 December 2022
About Author
Ravindra Savaram

Ravindra Savaram is a Content Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

Recommended Courses

1 /15