db_init.sh 415 B

123456789101112
  1. #!/bin/bash
  2. mysql_install_db --user=mysql
  3. sleep 3
  4. mysqld_safe &
  5. sleep 3
  6. #mysqladmin -u "$MARIADB_USER" password "$MARIADB_PASS"
  7. mysql -e "use mysql; grant all privileges on *.* to '$MARIADB_USER'@'%' identified by '$MARIADB_PASS' with grant option;"
  8. h=$(hostname)
  9. mysql -e "use mysql; update user set password=password('$MARIADB_PASS') where user='$MARIADB_USER' and host='$h';"
  10. mysql -e "flush privileges;"
  11. run.sh