-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysql.js
38 lines (30 loc) · 1.27 KB
/
mysql.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// const mysql = require('mysql');
// const con = mysql.createConnection({
// host: "localhost",
// user: "root",
// password: "top4glory",
// database : 'headless1'
// });
// // con.end();
// con.connect(function(err) {
// if (err) throw err;
// console.log("Connected!");
// // let sql = "CREATE TABLE package_features (id int NOT NULL AUTO_INCREMENT PRIMARY KEY, url_hash VARCHAR(32) NOT NULL, url_origin_hash VARCHAR(32), url_base64 VARCHAR(1500), page_title VARCHAR(1500) DEFAULT NULL, isHtml TINYINT, isZip TINYINT)";
// // let sql = "CREATE TABLE favicon (id int NOT NULL AUTO_INCREMENT PRIMARY KEY, url_hash VARCHAR(32) NOT NULL, favicon_hash VARCHAR(32))";
// // let sql = ""
// con.query(sql, function (err, result) {
// if (err) throw err;
// console.log("Table created");
// });
// });
// // ALTER TABLE package_features ADD COLUMN total_favicons tinyint AFTER page_title;
// // ALTER TABLE package_features ADD COLUMN title_match tinyint AFTER page_title;
const md5File = require('md5-file')
let path = '/home/dev/nodesource_setup.sh'
md5File(path, (err, hash) => {
if (err) throw err
console.log(`The MD5 sum of LICENSE.md is: ${hash}`)
})
// md5File(path).then(hash => {
// console.log(`The MD5 sum of nodesource_setup.sh is: ${hash}`)
// })