-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
Code:
const conn = mysql.createConnection({
host: 'localhost',
port: 3306,
username: 'root',
password: '',
multipleStatements: true,
timeout: 5000
});
conn.connect((err) => {
if (err) {
// console.log(err.code);
// console.log(err.fatal);
// console.log(err.sql);
// console.log(err.sqlState);
// console.log(err.sqlMessage);
dialog.showErrorBox('Uh-Oh!', err.code);
return;
}
const SQL = 'SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = "' + db + '"';
conn.query(SQL, function (err, rows, fields) {
if (err) {
dialog.showErrorBox('Uh-Oh!', err.code);
return;
}
console.log(SQL);
console.log(rows); // []
console.log(fields);
});
});
When SQL
is dumped it returns:
SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = "survive"
However rows is always an empty array. When I run the exact query in PMA then:
I am not getting errors and I have tried connecting with debug: true
too.