安装MYSQL
yum install mariadb mariadb-server python2-PyMySQL -y
cp /usr/share/mariadb/my-medium.cnf /etc/my.cnf
修改配置文件vi /etc/my.cnf
【mysqld】
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
启动数据库
systemctl enable mariadb.service
systemctl start mariadb.service
初始化数据库密码
mysql_secure_installation
密码为lmk2451688
创建数据库keystone、glance、nova、neutron
mysql -uroot -plmk2451688
CREATE DATABASE keystone;
CREATE DATABASE glance;
CREATE DATABASE nova;
CREATE DATABASE nova_api;
CREATE DATABASE neutron;
CREATE DATABASE cinder;
###################################
把一下的#都替换成,51cto博客有bug不显示
为keystone用户授权
GRANT ALL PRIVILEGES ON keystone.# TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.# TO 'keystone'@'%' IDENTIFIED BY 'keystone';
FLUSH PRIVILEGES;
为glance授权
GRANT ALL PRIVILEGES ON glance.# TO 'glance'@'localhost' IDENTIFIED BY 'glance';
GRANT ALL PRIVILEGES ON glance.# TO 'glance'@'%' IDENTIFIED BY 'glance';
FLUSH PRIVILEGES;
为nova授权
GRANT ALL PRIVILEGES ON nova.# TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova.# TO 'nova'@'%' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_api.# TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_api.# TO 'nova'@'%' IDENTIFIED BY 'nova';
FLUSH PRIVILEGES;
为neutron授权
GRANT ALL PRIVILEGES ON neutron.# TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';
GRANT ALL PRIVILEGES ON neutron.# TO 'neutron'@'%' IDENTIFIED BY 'neutron';
FLUSH PRIVILEGES;
为cinder授权
GRANT ALL PRIVILEGES ON cinder.# TO 'cinder'@'localhost' IDENTIFIED BY 'cinder';
GRANT ALL PRIVILEGES ON cinder.# TO 'cinder'@'%' IDENTIFIED BY 'cinder';
FLUSH PRIVILEGES;
转载于:https://blog.51cto.com/13491150/2056595