Issue link: https://read.uberflip.com/i/1334488
Chapter 1 13 The steps outlined previously allow for a non-interactive installation of MySQL. You can omit this step, but during installation, it will ask for the root password. If you do opt for an interactive install, set openstack as the password for the root user. 2. We can now install and run MySQL by executing the following commands: sudo apt-get update sudo apt-get -y install mysql-server sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf sudo service mysql restart 3. Once that's done we then configure an appropriate database user, called nova, and privileges for use by OpenStack Compute. MYSQL_PASS=openstack mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;' mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%'" mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'nova'@'%' = PASSWORD('$MYSQL_PASS');" 4. We now simply reference our MySQL server in our /etc/nova/nova.conf file to use MySQL by adding in the --sql_connection flag. --sql_connection=mysql://nova:openstack@172.16.0.1/nova How it works... MySQL is an essential service to OpenStack as a number of services rely on it. Configuring MySQL appropriately ensures your servers operate smoothly. We first configured the Ubuntu debconf utility to set some defaults for our installation so that when MySQL gets installed, it finds values for the root user's password and so skips the part where it asks you for this information during installation. We then added in a database called nova that will eventually be populated by tables and data from the OpenStack Compute services and granted all privileges to the nova database user so that user can use it. Finally, we configured our OpenStack Compute installation to specify these details so they can use the nova database. See also f The MySQL clustering using Galera recipe in Chapter 11, In the Datacenter www.it-ebooks.info

