댓글 검색 목록

[Nodejs] MySQL client.

페이지 정보

작성자 운영자 작성일 20-01-25 17:42 조회 531 댓글 0

MySQL 프로토콜을 구현하는 순수 node.js JavaScript 클라이언트. 


https://github.com/mysqljs/mysql 


var mysql      = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'me',
  password : 'secret',
  database : 'my_db'
});

connection.connect();

connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
  if (error) throw error;
  console.log('The solution is: ', results[0].solution);
});

connection.end();




댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.