From 69c180d2e842995e58cc4cf2b878c2127b9d55fd Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:01:16 +0800 Subject: [PATCH 1/5] use CREATE USER to define account authentication characteristics --- mysql/startup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/startup b/mysql/startup index 320c8bb..4cd6356 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER'; +DROP USER IF EXISTS 'MYSQL_USER' IDENTIFIED BY 'MYSQL_PASSWORD'; CREATE USER 'MYSQL_USER'@'%'; CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; -GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; +GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%'; From d94de05fd4594411e8e30ae8fe31d94579bd5baa Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:06:45 +0800 Subject: [PATCH 2/5] use CREATE USER to define account authentication characteristics --- mysql/startup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/startup b/mysql/startup index 4cd6356..e813a12 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER' IDENTIFIED BY 'MYSQL_PASSWORD'; -CREATE USER 'MYSQL_USER'@'%'; +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%'; From 570be592bbf57139e16159b0cb22bce367347f6d Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:36:58 +0800 Subject: [PATCH 3/5] use '`' to quote identifier --- mysql/startup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql/startup b/mysql/startup index e813a12..863b93c 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER'; -CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; -CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; -GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%'; +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; +CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; +GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; \ No newline at end of file From bdcc2adf3fa19ac90eb621a5adf39e5b5e8ef059 Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:40:07 +0800 Subject: [PATCH 4/5] for file format --- mysql/startup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql/startup b/mysql/startup index 863b93c..2fd1645 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER'; -CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; -CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; -GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; \ No newline at end of file +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; +CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; +GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; From 1650af04cd8e4b73cd5f8d64a51bd9d388abe339 Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:41:03 +0800 Subject: [PATCH 5/5] align file format --- mysql/startup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/startup b/mysql/startup index 2fd1645..0a82f1d 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ DROP USER IF EXISTS 'MYSQL_USER'; CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; -GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; +GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%';