Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- });
- });
- SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = "survive"
Add Comment
Please, Sign In to add comment