Cannot properly connect to a database using JS & mySql
I've done some research and cannot seem to find the issue. My database simply cannot connect.
var con = mysql.createConnection(
host: "***********",
user: "NodeSupport",
password: "**********",
database: 'NodeBot',
port: 2083,
);
con.connect(function(err)
if (err) throw err;
console.log("Connected!");
);
The host being the IP Address you can see on the PhpmyAdmin page.
The password and username being my mysql account linked up to the database.
I something find myself seeing this error
Error: Packets out of order. Got: 80 Expected: 0
at Parser.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolParser.js:42:19)
at Protocol.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:38:16)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:91:28)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:502:10)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
--------------------
at Protocol._enqueue (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:144:48)
at Protocol.handshake (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:51:23)
at Connection.connect (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:118:18)
at Object.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotindex.js:71:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Edit- It never logs "connected"
javascript mysql
add a comment |
I've done some research and cannot seem to find the issue. My database simply cannot connect.
var con = mysql.createConnection(
host: "***********",
user: "NodeSupport",
password: "**********",
database: 'NodeBot',
port: 2083,
);
con.connect(function(err)
if (err) throw err;
console.log("Connected!");
);
The host being the IP Address you can see on the PhpmyAdmin page.
The password and username being my mysql account linked up to the database.
I something find myself seeing this error
Error: Packets out of order. Got: 80 Expected: 0
at Parser.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolParser.js:42:19)
at Protocol.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:38:16)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:91:28)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:502:10)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
--------------------
at Protocol._enqueue (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:144:48)
at Protocol.handshake (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:51:23)
at Connection.connect (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:118:18)
at Object.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotindex.js:71:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Edit- It never logs "connected"
javascript mysql
1
are you sure the port is correct? The typical mysql port is 3306
– Derek Pollard
Nov 11 at 6:15
@DerekPollard This is the exact website that leads directly to my database inside mysql. a2plcpnl0221.prod.iad2.secureserver.net:2083/cpsess6039422174/…
– M. McFall
Nov 11 at 15:03
2083 is cPanels port, not mysql
– Derek Pollard
Nov 11 at 18:55
add a comment |
I've done some research and cannot seem to find the issue. My database simply cannot connect.
var con = mysql.createConnection(
host: "***********",
user: "NodeSupport",
password: "**********",
database: 'NodeBot',
port: 2083,
);
con.connect(function(err)
if (err) throw err;
console.log("Connected!");
);
The host being the IP Address you can see on the PhpmyAdmin page.
The password and username being my mysql account linked up to the database.
I something find myself seeing this error
Error: Packets out of order. Got: 80 Expected: 0
at Parser.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolParser.js:42:19)
at Protocol.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:38:16)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:91:28)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:502:10)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
--------------------
at Protocol._enqueue (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:144:48)
at Protocol.handshake (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:51:23)
at Connection.connect (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:118:18)
at Object.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotindex.js:71:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Edit- It never logs "connected"
javascript mysql
I've done some research and cannot seem to find the issue. My database simply cannot connect.
var con = mysql.createConnection(
host: "***********",
user: "NodeSupport",
password: "**********",
database: 'NodeBot',
port: 2083,
);
con.connect(function(err)
if (err) throw err;
console.log("Connected!");
);
The host being the IP Address you can see on the PhpmyAdmin page.
The password and username being my mysql account linked up to the database.
I something find myself seeing this error
Error: Packets out of order. Got: 80 Expected: 0
at Parser.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolParser.js:42:19)
at Protocol.write (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:38:16)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:91:28)
at Socket.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:502:10)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
--------------------
at Protocol._enqueue (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:144:48)
at Protocol.handshake (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibprotocolProtocol.js:51:23)
at Connection.connect (C:UsersMatthewDesktopExtrasDiscordBotnode_modulesmysqllibConnection.js:118:18)
at Object.<anonymous> (C:UsersMatthewDesktopExtrasDiscordBotindex.js:71:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Edit- It never logs "connected"
javascript mysql
javascript mysql
edited Nov 12 at 2:40
Isaac Bennetch
7,69621629
7,69621629
asked Nov 11 at 5:53
M. McFall
31
31
1
are you sure the port is correct? The typical mysql port is 3306
– Derek Pollard
Nov 11 at 6:15
@DerekPollard This is the exact website that leads directly to my database inside mysql. a2plcpnl0221.prod.iad2.secureserver.net:2083/cpsess6039422174/…
– M. McFall
Nov 11 at 15:03
2083 is cPanels port, not mysql
– Derek Pollard
Nov 11 at 18:55
add a comment |
1
are you sure the port is correct? The typical mysql port is 3306
– Derek Pollard
Nov 11 at 6:15
@DerekPollard This is the exact website that leads directly to my database inside mysql. a2plcpnl0221.prod.iad2.secureserver.net:2083/cpsess6039422174/…
– M. McFall
Nov 11 at 15:03
2083 is cPanels port, not mysql
– Derek Pollard
Nov 11 at 18:55
1
1
are you sure the port is correct? The typical mysql port is 3306
– Derek Pollard
Nov 11 at 6:15
are you sure the port is correct? The typical mysql port is 3306
– Derek Pollard
Nov 11 at 6:15
@DerekPollard This is the exact website that leads directly to my database inside mysql. a2plcpnl0221.prod.iad2.secureserver.net:2083/cpsess6039422174/…
– M. McFall
Nov 11 at 15:03
@DerekPollard This is the exact website that leads directly to my database inside mysql. a2plcpnl0221.prod.iad2.secureserver.net:2083/cpsess6039422174/…
– M. McFall
Nov 11 at 15:03
2083 is cPanels port, not mysql
– Derek Pollard
Nov 11 at 18:55
2083 is cPanels port, not mysql
– Derek Pollard
Nov 11 at 18:55
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246218%2fcannot-properly-connect-to-a-database-using-js-mysql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246218%2fcannot-properly-connect-to-a-database-using-js-mysql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
are you sure the port is correct? The typical mysql port is 3306
– Derek Pollard
Nov 11 at 6:15
@DerekPollard This is the exact website that leads directly to my database inside mysql. a2plcpnl0221.prod.iad2.secureserver.net:2083/cpsess6039422174/…
– M. McFall
Nov 11 at 15:03
2083 is cPanels port, not mysql
– Derek Pollard
Nov 11 at 18:55