Skip to content

Commit fcaf42d

Browse files
build 2 - v1.7.0
1 parent 8cfef8c commit fcaf42d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dist/src/cli.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ async function main() {
4242
console.log('Creating ephemeral MySQL database...');
4343
const db = await (0, index_1.createDB)(options);
4444
console.log(`A MySQL databases has been successfully created with the following parameters:\n\nUsername: ${db.username} \nDatabase Name: ${db.dbName} \nPort: ${db.port} \nX Plugin Port: ${db.xPort} \nSocket: ${db.socket} \nX Plugin Socket: ${db.xSocket}\n`);
45-
console.log(`If you want to use the MySQL CLI client to connect to the database, you can use either commands: \nmysql -u ${db.username} -P ${db.port} --protocol tcp \nOR\nmysql -u ${db.username} --socket ${db.socket}`);
45+
if (process.platform === 'win32') {
46+
//The connection information logs will be different for Windows compared to other platforms.
47+
//Windows uses mysqlsh instead of mysql to invoke the client shell, needs a --sql flag to be put into SQL mode, and also does not have a protocol flag.
48+
//Also according to https://bugs.mysql.com/bug.php?id=106852, you cannot log into a MySQL database with a named pipe for the first connection so a socket connection suggestion
49+
//should only be displayed for non-Windows platforms.
50+
console.log(`If you want to use the MySQL CLI client to connect to the database, you can use the following command: \nmysqlsh --sql -u ${db.username} -P ${db.port}\nIf prompted for a password, leave the password field blank. The database does not have a password set.`);
51+
}
52+
else {
53+
console.log(`If you want to use the MySQL CLI client to connect to the database, you can use either commands: \nmysql -u ${db.username} -P ${db.port} --protocol tcp \nOR\nmysql -u ${db.username} --socket ${db.socket}\nIf prompted for a password, leave the password field blank. The database does not have a password set.`);
54+
}
4655
}
4756
main();

0 commit comments

Comments
 (0)