Skip to content

Commit 5bf3141

Browse files
committed
Fix mysqldef connection for empty password
Always include -p parameter for MySQL even with empty password. mysqldef expects -p with empty string for passwordless connections.
1 parent e8289e0 commit 5bf3141

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

dist/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ function getCommandConfig(command) {
126126
config.args.push("-h", host, "-P", port);
127127
if (user)
128128
config.args.push("-u", user);
129-
// Only add -p flag if password is not empty
130-
if (password && password.trim() !== "") {
131-
config.args.push(`-p${password}`);
132-
}
129+
// Always include -p with the password value (even if empty)
130+
// mysqldef accepts -p with empty string for passwordless connections
131+
config.args.push(`-p${password}`);
133132
if (database)
134133
config.args.push(database);
135134
break;

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,9 @@ function getCommandConfig(command: string): CommandConfig {
100100

101101
config.args.push("-h", host, "-P", port);
102102
if (user) config.args.push("-u", user);
103-
// Only add -p flag if password is not empty
104-
if (password && password.trim() !== "") {
105-
config.args.push(`-p${password}`);
106-
}
103+
// Always include -p with the password value (even if empty)
104+
// mysqldef accepts -p with empty string for passwordless connections
105+
config.args.push(`-p${password}`);
107106
if (database) config.args.push(database);
108107
break;
109108
}

0 commit comments

Comments
 (0)