You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request support for SSL connections in the @databases/mysql package similar to how it is implemented in the mysql2 package. Currently, I need to use SSL connections for secure database connections, and having this feature in @databases/mysql would greatly benefit my use case.
Additional Context:
I am testing the code from the documentation:
constcreateConnectionPool=require('@databases/mysql');const{ sql }=require('@databases/mysql');asyncfunctionrun(){// N.B. you will need to replace this connection// string with the correct string for your database.constdb=createConnectionPool("mysql://db_user:db_password@db_host:db_port/db_name",);constresults=awaitdb.query(sql` SELECT 1 + 1 as result; `);console.log(results);// => [{result: 2}]awaitdb.dispose();}run().catch((err)=>{console.error(err);process.exit(1);});
However, I encountered the following error:
{
uri: 'mysql://db_user:db_password@db_host:db_port/db_name, multipleStatements: true, timezone: 'local', typeCast: [Function: typeCast]}{ maxSize: 10, maxUses: Infinity, idleTimeoutMilliseconds: 30000, queueTimeoutMilliseconds: 60000}Ignoring invalid configuration option passed to Connection: schema. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a ConnectionError: Access denied for user 'db_user'@'db_host' (using password: YES)...{ code: 'ER_ACCESS_DENIED_ERROR', errno: 1045, sqlState: '28000'}
Providing the Certificate Authority (CA) in the configuration for mysql2 resolves any SSL-related issues.
```javascriptconstmysql=require('mysql2/promise');asyncfunctionrun(){constconnection=awaitmysql.createConnection({host: 'db_host',user: 'db_user',password: 'db_password',database: 'db_name',port: 'db_port',ssl: {ca: require('fs').readFileSync('path/to/ca.pem'),// Provide the CA certificate path},});try{const[rows,fields]=awaitconnection.execute('SELECT 1 + 1 as result');console.log(rows);// => [{result: 2}]}finally{connection.end();}}run().catch((err)=>{console.error(err);process.exit(1);});
The text was updated successfully, but these errors were encountered:
Feature Request: SSL Connection Support for MySQL
Description:
I would like to request support for SSL connections in the
@databases/mysql
package similar to how it is implemented in the mysql2 package. Currently, I need to use SSL connections for secure database connections, and having this feature in@databases/mysql
would greatly benefit my use case.Additional Context:
I am testing the code from the documentation:
However, I encountered the following error:
Providing the Certificate Authority (CA) in the configuration for mysql2 resolves any SSL-related issues.
The text was updated successfully, but these errors were encountered: