use CREATE USER to define account authentication characteristics

This commit is contained in:
spuch 2017-03-20 15:01:16 +08:00
parent 9ae6e45dda
commit 69c180d2e8

View File

@ -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'@'%';