From 9b9d105c59c6d94df3a32bb71882e219597cd8d5 Mon Sep 17 00:00:00 2001 From: xixing Date: Mon, 12 Oct 2015 11:46:56 +0800 Subject: [PATCH] create [local and remote] user DB_USER with passwd DB_PASS --- scripts/firstrun_maria | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/firstrun_maria b/scripts/firstrun_maria index 9920262..7345bf6 100755 --- a/scripts/firstrun_maria +++ b/scripts/firstrun_maria @@ -55,6 +55,14 @@ firstrun_maria() { echo "Disabled" fi + + # 1. Create localhost db user DB_USER with root privilieges + # 2. Create remote db user DB_USER with root privilieges + mysql -uroot -e "CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASS}'; GRANT ALL PRIVILEGES ON *.* TO '${DB_USER}'@'localhost' WITH GRANT OPTION;" + mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '${DB_PASS}'; GRANT ALL PRIVILEGES ON *.* TO '${DB_USER}'@'%' WITH GRANT OPTION;" + + + # shutdown mariadb to wait for supervisor mysqladmin -u root shutdown -- Gitee