- Learning OpenStack Networking
- James Denton
- 270字
- 2025-02-24 14:51:46
Installing and configuring the MySQL database server
On the controller node, use apt to install the MySQL database service and related Python packages:
# apt install mariadb-server python-pymysql
If prompted, set the password to openstack.
Once installed, create and edit the /etc/mysql/mariadb.conf.d/99-openstack.cnf configuration file. Add the [mysqld] block and the bind-address definition. Doing so will allow connectivity to MySQL from other hosts in the environment. The value for bind-address should be the management IP of the controller node:
[mysqld]
bind-address = 10.10.0.100
In addition to adding the bind-address definition, add the following options to the [mysqld]section as well:
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
Save and close the file, then restart the mysql service:
# systemctl restart mysql
The MySQL secure installation utility is used to build the default MySQL database and to set a password for the MySQL root user. The following command will begin the MySQL installation and configuration process:
# mysql_secure_installation
During the MySQL installation process, you will be prompted to enter a password and change various settings. The default root password may not yet be set. When prompted, set a root password of openstack. A more secure password suitable for your environment is highly recommended.
Answer [Y]es to the remaining questions to exit the configuration process. At this point, the MySQL server has been successfully installed on the controller node.