質問編集履歴
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,6 +4,42 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
+
```ここに言語を入力
|
8
|
+
|
9
|
+
var mysql = require('mysql');
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
var connection = mysql.createConnection({
|
14
|
+
|
15
|
+
host : 'localhost',
|
16
|
+
|
17
|
+
user : 'root',
|
18
|
+
|
19
|
+
database : 'join_us' //the name of your db
|
20
|
+
|
21
|
+
});
|
22
|
+
|
23
|
+
var q = 'SELECT CURTIME() as time, CURDATE() as date, NOW() as now';
|
24
|
+
|
25
|
+
connection.query(q, function (error, results, fields) {
|
26
|
+
|
27
|
+
if (error) throw error;
|
28
|
+
|
29
|
+
console.log(results[0].time);
|
30
|
+
|
31
|
+
console.log(results[0].date);
|
32
|
+
|
33
|
+
console.log(results[0].now);
|
34
|
+
|
35
|
+
});
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
```
|
42
|
+
|
7
43
|
|
8
44
|
|
9
45
|
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
|