質問編集履歴
4
mysql2に変更しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,6 +16,8 @@
|
|
16
16
|
|
17
17
|
```
|
18
18
|
|
19
|
+
/Users/Desktop/Programming/Studying/Doing/Express/app.js:15
|
20
|
+
|
19
21
|
if (error) throw error;
|
20
22
|
|
21
23
|
^
|
@@ -24,29 +26,7 @@
|
|
24
26
|
|
25
27
|
Error: connect ECONNREFUSED 127.0.0.1:3306
|
26
28
|
|
27
|
-
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
|
29
|
+
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
|
28
|
-
|
29
|
-
--------------------
|
30
|
-
|
31
|
-
at Protocol._enqueue (/Users//Desktop/Programming/Studying/Doing/Express/node_modules/mysql/lib/protocol/Protocol.js:144:48)
|
32
|
-
|
33
|
-
at Protocol.handshake (/Users//Desktop/Programming/Studying/Doing/Express/node_modules/mysql/lib/protocol/Protocol.js:51:23)
|
34
|
-
|
35
|
-
at Connection.connect (/Users//Desktop/Programming/Studying/Doing/Express/node_modules/mysql/lib/Connection.js:116:18)
|
36
|
-
|
37
|
-
at Object.<anonymous> (/Users//Desktop/Programming/Studying/Doing/Express/app.js:14:12)
|
38
|
-
|
39
|
-
at Module._compile (internal/modules/cjs/loader.js:1158:30)
|
40
|
-
|
41
|
-
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
|
42
|
-
|
43
|
-
at Module.load (internal/modules/cjs/loader.js:1002:32)
|
44
|
-
|
45
|
-
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
|
46
|
-
|
47
|
-
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
|
48
|
-
|
49
|
-
at internal/main/run_main_module.js:18:47 {
|
50
30
|
|
51
31
|
errno: 'ECONNREFUSED',
|
52
32
|
|
3
sql2にしました
test
CHANGED
File without changes
|
test
CHANGED
@@ -74,7 +74,7 @@
|
|
74
74
|
|
75
75
|
const express = require("express");
|
76
76
|
|
77
|
-
const mysql = require("mysql");
|
77
|
+
const mysql = require("mysql2");
|
78
78
|
|
79
79
|
|
80
80
|
|
@@ -152,7 +152,7 @@
|
|
152
152
|
|
153
153
|
"express": "^4.17.1",
|
154
154
|
|
155
|
-
"mysql": "^2.
|
155
|
+
"mysql2": "^2.2.5"
|
156
156
|
|
157
157
|
},
|
158
158
|
|
2
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
【MySQL】Node.jsからmysqlにアクセスしようとするDBサーバーの問題かうまくいきません
|
1
|
+
【MySQL】Node.jsからmysqlにアクセスしようとすると、DBサーバーの問題かうまくいきません
|
test
CHANGED
File without changes
|
1
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Node.jsからmysqlにアクセスしようとするDBサーバーの問題かうまくいきません
|
1
|
+
【MySQL】Node.jsからmysqlにアクセスしようとするDBサーバーの問題かうまくいきません
|
test
CHANGED
File without changes
|