dbgate icon indicating copy to clipboard operation
dbgate copied to clipboard

QUESTION: "Error: Could not find engine driver mysql"

Open epsa-dev opened this issue 2 years ago • 2 comments

Details:

Error: Could not find engine driver mysql

const dbgateApi = require('dbgate-api'); const dbgatePluginMysql = require("dbgate-plugin-mysql"); const dbgatePluginCsv = require("dbgate-plugin-csv");

dbgateApi.registerPlugins(dbgatePluginMysql);

async function run() { const reader = await dbgateApi.tableReader({ connection: { server: 'localhost', engine: 'mysql', user: 'root', password: 'xxxx', database: 'DB_NAME' }, }); //const writer = await dbgatePluginCsv.shellApi.writer({ fileName: 'Customer.csv' }); //await dbgateApi.copyStream(reader, writer); console.log('Finished job script'); } dbgateApi.runScript(run);

epsa-dev avatar Sep 09 '22 19:09 epsa-dev

engine parameter should contain plugin name: "mysql@dbgate-plugin-mysql"

janproch avatar Sep 09 '22 19:09 janproch

It is working now? if you use engine: engine: 'mysql@dbgate-plugin-mysql' instead of engine: engine: 'mysql'

Probably this script is generated from very old version, before plugins introduced (>1 year)

janproch avatar Sep 11 '22 06:09 janproch