Sha256: e7e8525a123975bb639f5aecc363ca095dfe002c9346cc74320ad95e733855ad

Contents?: true

Size: 859 Bytes

Versions: 39

Compression:

Stored size: 859 Bytes

Contents

DB_NAME=<%= @attributes.db_database %>
DB_USER=<%= @attributes.db_username %>
DB_PWD=<%= @attributes.db_password %>
DB_ROOT_PWD=<%= @attributes.mysql_root_password %>

if sunzi.to_be_done "install mysql"; then
  sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $DB_ROOT_PWD"
  sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $DB_ROOT_PWD"
  sunzi.install "mysql-server"
  sunzi.install "mysql-client"
  sunzi.install "libmysqlclient-dev"

  sudo -u root mysql -proot -e "create database $DB_NAME;"
  sudo -u root mysql -proot -e "create user '$DB_USER'@'localhost' identified by '$DB_PWD';"
  sudo -u root mysql -proot -e "grant all privileges on $DB_NAME.* to '$DB_USER'@'%' identified by '$DB_PWD';"
  sudo -u root mysql -proot -e "flush privileges;"

  sunzi.done "install mysql"
fi

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
sunzi-rails-0.2.21 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.20 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.3.0 lib/templates/create/recipes/mysql.sh
o2webappizer-0.2.6 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.2.5 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.2.4 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.2.3 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.2.2 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.2.1 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.2.0 templates/config/sunzi/recipes/mysql.sh
sunzi-rails-0.2.19 lib/templates/create/recipes/mysql.sh
o2webappizer-0.1.15 templates/config/sunzi/recipes/mysql.sh
sunzi-rails-0.2.18 lib/templates/create/recipes/mysql.sh
o2webappizer-0.1.14 templates/config/sunzi/recipes/mysql.sh
sunzi-rails-0.2.17 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.16 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.15 lib/templates/create/recipes/mysql.sh
o2webappizer-0.1.13 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.1.12 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.1.11 templates/config/sunzi/recipes/mysql.sh