SQL密码问题

时间:2017-09-21 20:51:16

标签: mysql sql

我有一个database.cfg文件,其中包含:

dbDriver=com.mysql.jdbc.Driver
dbUrl=jdbc:mysql://localhost:3306/
dbUser=admin
dbPasswd=ascd                                                                 

因此,请考虑另一个名为create.sql的文件,其中包含:

use mysql;

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost';
--
--
-- DE1284: whc - the line with IDENTIFIED BY is used during install to get the default password
--
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'
      IDENTIFIED BY 'abcd';
/* note: here "abcd " is password and same as in database.cfg and same as dbPasswd=ascd.
--
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%'
      IDENTIFIED BY 'abcd';
/* note: here "abcd " is password and same as in database.cfg and same as dbPasswd=ascd.
--
FLUSH PRIVILEGES;

DROP DATABASE IF EXISTS metric;
CREATE DATABASE metric;

USE metric;

所以现在在这个名为" create.sql"的文件中,而不是使用密码" abcd"如何从文件" Database.cfg"中调用此密码。我需要一些帮助。

0 个答案:

没有答案