When trying to connect to a MySQL database by using the newly added node-mysql2 dialect, it is not possible to connect to a database using a password.
Reason: I researched a bit myself in the repository and have seen that the used connection method within Knex.js' mysql2 dialect is using 'user', 'database' and 'connection' property only:
var connection = mysql2.createConnection(_.pick(this.connectionSettings, 'user', 'database', 'connection'));
Is there any reason for doing so? According to the node-mysql2 description and docs it should be fully API compatible to the node-mysql module, so I'd suggest to just use same .createConnection() call as it is used in Knex' mysql dialect:
var connection = mysql.createConnection(this.connectionSettings);
I tried it out and now it also did work when using a password for database access...
Many greets, and thanks for the amazing module,
The text was updated successfully, but these errors were encountered:
It looked like the reason was that if invalid options were passed, node-mysql2 really didn't seem to like it. I went ahead and picked out all of the options that seemed relevant password, ssl, connection, stream - pushed in the latest release, let me know if you have any more issues.