Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. var mysql = require('mysql');
  2. var connection = mysql.createConnection(
  3. {
  4. host : 'localhost',
  5. user : 'root',
  6. password : '1234',
  7. database : 'test'
  8. }
  9. );
  10.  
  11. connection.connect();
  12.  
  13. connection.query('select * from test_table', function(error, result, fields){
  14. if(error){
  15. console.log(error)
  16. }
  17. console.log(result);
  18. });
  19.  
  20. connection.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement