Niansuh commited on
Commit
818866f
1 Parent(s): 3828f78

Create database.js

Browse files
Files changed (1) hide show
  1. database.js +16 -0
database.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const mysql = require('mysql2');
2
+
3
+ const db = mysql.createConnection({
4
+ host: '31.220.97.62',
5
+ user: 'myapi',
6
+ password: '57rfPPY8bsFBasXX',
7
+ database: 'myapi',
8
+ port: 3306
9
+ });
10
+
11
+ db.connect((err) => {
12
+ if (err) throw err;
13
+ console.log('Connected to MySQL Database');
14
+ });
15
+
16
+ module.exports = db;