3.4. Create the Identity Database

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

Procedure 3.1. Creating the Identity Service database

  1. Connect to the database service using the mysql command.
    # mysql -u root -p
  2. Create the keystone database.
    mysql> CREATE DATABASE keystone;
  3. Create a keystone database user and grant it access to the keystone database.
    mysql> GRANT ALL ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'PASSWORD';
    mysql> GRANT ALL ON keystone.* TO 'keystone'@'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 database has been created. The database will be populated during service configuration.