search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Programming Dictionary

Online technical manual for service programmers
Popular searches:
Dictionary homepage JavaScript Node.js Node.js connects to MySQL
Node.js connects to MySQL Detailed instructions for use

Node.js connects to MySQL

Chinese translation Recent Updates: 2018-06-21 10:32:05

Node.js is a platform built on the Chrome JavaScript runtime.

Node.js is an event-driven I/O server-side JavaScript environment based on Google's V8 engine. The V8 engine executes Javascript very quickly and has very good performance.

Node.js connects to MySQL syntax

Use Node.js to connect to MySQL and operate the database.

Node.js connects to MySQL example

var mysql      = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',  user     : 'root',  password : '123456',  database : 'test'}); 
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);});
Node.js connects to MySQL