Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改数据库连接地址缺少参数 #113

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ private static void initUserAccount(SystemConfig config) throws SQLException, IO

String metaDatabase = config.getMetaDbName();
String innerUser = config.getMetaDbUser();
String metaDbProp = config.getMetaDbProp();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you debuging cn?
I don't understand why these properties are useful here, casue they seems to be defalut settings..
截屏2022-12-08 12 18 46

String innerPasswd = PasswdUtil.genRandomPasswd(12);
String innerPasswdEnc = PasswdUtil.encrypt(innerPasswd);
config.setMetaDbPasswd(PasswdUtil.encrypt(innerPasswd));
Expand All @@ -182,7 +183,7 @@ private static void initUserAccount(SystemConfig config) throws SQLException, IO
metaDbAddr.getKey(),
metaDbAddr.getValue(),
rootDb,
"",
metaDbProp,
rootUser,
rootPasswd)) {

Expand Down Expand Up @@ -230,7 +231,7 @@ private static void createInnerUser(SystemConfig config, String addr, String pas
String sqlCreateUser = "CREATE USER %s IDENTIFIED WITH mysql_native_password BY '%s'";
String sqlGrantPrivileges = "GRANT ALL PRIVILEGES ON *.* TO %s";
String innerUser = config.getMetaDbUser();

String metaDbProp = config.getMetaDbProp();
Pair<String, Integer> ipPort = AddressUtils.getIpPortPairByAddrStr(addr);

String rootDb = "mysql";
Expand All @@ -241,7 +242,7 @@ private static void createInnerUser(SystemConfig config, String addr, String pas
ipPort.getKey(),
ipPort.getValue(),
rootDb,
"",
metaDbProp,
rootUser,
rootPasswd)) {

Expand Down