Guest User

Untitled

a guest
Nov 15th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. const mysql = require('mysql')
  2. const connection = mysql.createConnection({
  3. host: 'localhost',
  4. user: 'root',
  5. password: '',
  6. database: 'fatcat'
  7. })
  8. connection.connect((err) => {
  9. if (err) {
  10. console.log('Error connecting to MySQL database: ' + err)
  11. return
  12. }
  13. console.log('Connected to MySQL database')
  14. connection.query('SELECT 1 AS solution', () => (err, results, fields) => {
  15. console.log('queried')
  16. })
  17. })
Add Comment
Please, Sign In to add comment