Configuring the SQL Database (MySQL) on the Cloud ControllerStart the mysql command line client by running:$mysql -u root -pEnter the mysql root user's password when prompted.To configure the MySQL database, create the nova database.mysql>CREATE DATABASE nova;Create a MySQL user and password for the newly-created nova database that has full control
of the database.mysql>GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY '[YOUR_NOVADB_PASSWORD]';mysql>GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '[YOUR_NOVADB_PASSWORD]';In the above commands, even though the 'nova'@'%' also matches
'nova'@'localhost', you must explicitly specify the
'nova'@'localhost' entry.By default, MySQL will create entries in the user table with
User='' and Host='localhost'. The
User='' acts as a wildcard, matching all users. If you do not
have the 'nova'@'localhost' account, and you try to log in as the
nova user, the precedence rules of MySQL will match against the User=''
Host='localhost' account before it matches against the
User='nova' Host='%' account. This will result in an error
message that looks like:ERROR 1045 (28000): Access denied for user 'nova'@'localhost' (using password: YES)Thus, we create a separate User='nova' Host='localhost' entry that
will match with higher precedence.See the MySQL documentation on connection verification for more details on how MySQL
determines which row in the user table it uses when authenticating connections.Enter quit at the mysql> prompt to exit MySQL.mysql>quitThe command to populate the database is described later in the
documentation, in the Section entitled Configuring the Database for Compute.
Securing MySQL
Additional steps are required to configure MySQL for production mode.
In particular, anonymous accounts should be removed. On several distributions,
these accounts can be removed by running the following script
after installing mysql:
/usr/bin/mysql_secure_installation