5.4. Create the Image Service Database

In this procedure, the database and database user that will be used by the Image service will be created. These steps must be performed while logged in to the database server as the root user (or as a user with suitable access: create db, create user, grant permissions).

Procedure 5.1. Creating the Image Service database

  1. Connect to the database service using the mysql command.
    # mysql -u root -p
  2. Create the glance database.
    mysql> CREATE DATABASE glance;
  3. Create a glance database user and grant it access to the glance database.
    mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY 'PASSWORD';
    mysql> GRANT ALL ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'PASSWORD';
    Replace PASSWORD with a secure password that will be used to authenticate with the database server as this user.
  4. Flush the database privileges to ensure that they take effect immediately.
    mysql> FLUSH PRIVILEGES;
  5. Exit the mysql client.
    mysql> quit
The Image Service database has been created. The database will be populated during service configuration.