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
o2webappizer-0.1.10 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.1.9 templates/config/sunzi/recipes/mysql.sh
o2webappizer-0.1.8 templates/config/sunzi/recipes/mysql.sh
sunzi-rails-0.2.14 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.13 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.12 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.11 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.10 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.9 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.8 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.7 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.6 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.5 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.4 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.3 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.2 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.1 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.2.0 lib/templates/create/recipes/mysql.sh
sunzi-rails-0.1.0 lib/templates/create/recipes/mysql.sh