forked from iteming/nodejs-website-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
39 lines (30 loc) · 801 Bytes
/
install.sh
File metadata and controls
39 lines (30 loc) · 801 Bytes
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
39
#!/bin/bash
echo " >>---------- 开始安装 ----------"
cd /home/
rm -rf nodejs
mkdir nodejs
cd /home/
cp NodeTest.zip /home/nodejs/
cd /home/nodejs/
unzip NodeTest.zip
cd /home/nodejs/NodeTest
echo " >>---------- 开始执行mysql ----------"
mysql -uroot -p6sL9lqEt --default-character-set=utf8 -e "
drop database if exists node_cms;
create database node_cms;
use node_cms;
source /home/nodejs/NodeTest/doc/install.sql"
echo " >>---------- 执行mysql结束 ----------"
cd /home/nodejs/NodeTest
: routes/jdbc.js w! "var mysql = require('mysql');
var pool = mysql.createPool({
host: '127.0.0.1',
port: '3306',
user: 'root',
password: '6sL9lqEt',
database: 'node_cms'
});
exports.pool=pool;"
chmod 777 start.sh
./start.sh
echo " >>---------- 安装结束 ----------"