Created
June 30, 2015 12:47
-
-
Save baniol/c6b81d79fab3f7638e37 to your computer and use it in GitHub Desktop.
mysql provision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum list installed "mysql-server" > /dev/null>&1 | |
if [[ $? -ne 0 ]]; then | |
echo " >>> Install mysql-server" | |
yum install -y mysql-server | |
fi | |
yum list installed "mysql" > /dev/null>&1 | |
if [[ $? -ne 0 ]]; then | |
echo " >>> Install mysql" | |
yum install -y mysql | |
fi | |
chkconfig --levels 235 mysqld on | |
service mysqld start | |
mysql -uroot << EOF | |
CREATE USER "myuser"@"localhost" IDENTIFIED BY "test"; | |
GRANT ALL PRIVILEGES ON *.* TO "myuser"@"localhost" IDENTIFIED BY "test"; | |
FLUSH PRIVILEGES; | |
create database loadtest; | |
use loadtest; | |
source /root/Projects/provision/customer.sql; | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment