标签:mysql shell
#!/bin/bash for db in keystone glance nova neutron cinder swift heat do mysql -e "create database $db;" mysql -e "grant all privileges on ${db}.* to ‘${db}‘@‘localhost‘ identified by ‘`echo ${db} | tr ‘[a-z]‘ ‘[A-Z]‘`_DBPASS‘;" mysql -e "grant all privileges on ${db}.* to ‘${db}‘@‘10.1.%.%‘ identified by ‘`echo ${db} | tr ‘[a-z]‘ ‘[A-Z]‘`_DBPASS‘;" done
本文出自 “Happy实验室” 博客,谢绝转载!
标签:mysql shell
原文地址:http://happylab.blog.51cto.com/1730296/1617720