# MySQL Server not accepting connections

**URL:** <https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210>\
**Category:** Hosting Support\
**Created:** [August 6, 2023, 11:36am UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210 "2023-08-06T11:36:35Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [August 6, 2023, 1:48pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/21 "2023-08-06T13:48:26Z")

</div>

No. The workbench is for interacting with the server under a gui, but is not necessary to run the server.

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 1:59pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/22 "2023-08-06T13:59:17Z")

</div>

Is there a tutorial on how to start a local MySQL server?

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [August 6, 2023, 2:00pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/23 "2023-08-06T14:00:51Z")

</div>

After installation it should be kept running even after reboot, so you shouldn’t worry.

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 3:27pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/24 "2023-08-06T15:27:18Z")

</div>

Ok, but it is now telling me this:

Error connecting to the database: Error: ER\_NOT\_SUPPORTED\_AUTH\_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client  
at Sequence.\_packetToError (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\sequences\Sequence.js:47:14)  
at Handshake.ErrorPacket (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\sequences\Handshake.js:123:18)  
at Protocol.\_parsePacket (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\Protocol.js:291:23)  
at Parser.\_parsePacket (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\Parser.js:433:10)  
at Parser.write (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\Parser.js:43:10)  
at Protocol.write (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\Protocol.js:38:16)  
at Socket. (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\Connection.js:88:28)  
at Socket. (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\Connection.js:526:10)  
at Socket.emit (node:events:514:28)  
at addChunk (node:internal/streams/readable:324:12)  
--------------------  
at Protocol.\_enqueue (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\Protocol.js:144:48)  
at Protocol.handshake (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\protocol\Protocol.js:51:23)  
at Connection.connect (C:\Users\HP\Desktop\server\node\_modules\mysql\lib\Connection.js:116:18)  
at Object. (C:\Users\HP\Desktop\server\index.js:16:12)  
at Module.\_compile (node:internal/modules/cjs/loader:1256:14)  
at Module.\_extensions…js (node:internal/modules/cjs/loader:1310:10)  
at Module.load (node:internal/modules/cjs/loader:1119:32)  
at Module.\_load (node:internal/modules/cjs/loader:960:12)  
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run\_main:81:12)  
at node:internal/main/run\_main\_module:23:47 {  
code: ‘ER\_NOT\_SUPPORTED\_AUTH\_MODE’,  
errno: 1251,  
sqlMessage: ‘Client does not support authentication protocol requested by server; consider upgrading MySQL client’,  
sqlState: ‘08004’,  
fatal: true

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [August 6, 2023, 3:30pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/25 "2023-08-06T15:30:10Z")

</div>

> <https://stackoverflow.com/questions/75704567/client-does-not-support-authentication-protocol-requested-by-server-error-in-bot>

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 3:39pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/26 "2023-08-06T15:39:29Z")

</div>

18:37:54 ALTER USER ‘root’ IDENTIFIED WITH mysql\_native\_password BY ‘(mypasswordhere)’ Error Code: 1396. Operation ALTER USER failed for ‘root’@‘%’ 0.125 sec

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘. TO ‘sqluser’@’%‘’ at line 1

didnt work

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [August 6, 2023, 3:50pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/27 "2023-08-06T15:50:22Z")

</div>

![image](https://forum-cdn.infinityfree.net/original/3X/d/b/dbb8d9e1595404a2eb3b76cc7a75f421ba3f45b3.png)

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 3:52pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/28 "2023-08-06T15:52:59Z")

</div>

mhm no, my username doesnt have an underline, its just “root”

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 3:56pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/29 "2023-08-06T15:56:52Z")

</div>

great, now its telling me " Access denied for user ‘root’@‘127.0.0.1’ to database ‘messages’"

Now its even screwed up even more, thanks

i think i should quit tbh, i just cant seem to get it work at all

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [August 6, 2023, 3:58pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/30 "2023-08-06T15:58:10Z")

</div>

I was thinking about this

> [@userbung](#):
>
> use near ‘. TO ‘sqluser’@’%‘’ at line 1

where do you have `sqluser` mentioned?

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 3:59pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/31 "2023-08-06T15:59:04Z")

</div>

i changed it to “root”, still not working

---

<div class="post-metadata">

**Author:** ![anon42008019](https://forum.infinityfree.com/letter_avatar/anon42008019/32/6_22734026db12803ebb3e059622ac3534.png) [@anon42008019](https://forum.infinityfree.com/u/anon42008019)\
**Post date:** [August 6, 2023, 4:03pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/32 "2023-08-06T16:03:17Z")

</div>

Can you paste what you are trying to execute here? In following format  
```  
code  
```

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 4:13pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/33 "2023-08-06T16:13:28Z")

</div>

Nevermind, the guy on stack overflow did a typo. I corrected it and it works. It now says the messages are saved on the database successfully. But still, when i refresh the site the messages go away

---

<div class="post-metadata">

**Author:** ![anon42008019](https://forum.infinityfree.com/letter_avatar/anon42008019/32/6_22734026db12803ebb3e059622ac3534.png) [@anon42008019](https://forum.infinityfree.com/u/anon42008019)\
**Post date:** [August 6, 2023, 4:16pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/34 "2023-08-06T16:16:38Z")

</div>

At this point the only person who can debug it is you.  
If you are programming the project yourself then you need to fetch the messages in database and display them when you load the page.

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 6, 2023, 10:46pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/35 "2023-08-06T22:46:01Z")

</div>

i cant debug it

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [August 6, 2023, 11:41pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/36 "2023-08-06T23:41:28Z")

</div>

> [@userbung](#):
>
> But still, when i refresh the site the messages go away

Are these messages related to user ID (and pass)  
so then it is “normal” for such information to be lost during refresh so nothing is displayed ?

but you can certainly store it this way [HTML Web Storage API](https://www.w3schools.com/html/html5_webstorage.asp)

or is it like the last 100 lines in one of the “chat rooms” so when someone enters then those messages should be displayed to all?

besides that, have you tried testing with another browser?  
also check other things like cookies

the problem can be super banal, you just need to see what is happening in the background.

  

If programming was easy then everyone would be a programmer

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 7, 2023, 5:46am UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/37 "2023-08-07T05:46:52Z")

</div>

the HTML Web Storage API stores it locally. I want this to be server-side meaning anyone can see it

When you send a message, it is saved as a row on a column called “text” on a MySQL database called “messages”. I want the code to fetch all the rows from that column and display it as the messages. There are no other columns.

The messages send in real time and everyone can see it.

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 7, 2023, 7:24am UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/38 "2023-08-07T07:24:32Z")

</div>

I posted it on stack overflow and someone told me to implement connection state recovery on [socket.io](http://socket.io) and it works and now the messages save and i have a real time forum

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [August 7, 2023, 11:07am UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/39 "2023-08-07T11:07:21Z")

</div>

Congratulations 🙂

Now you will still have to spend a large part of your time to get insured  
so that no one writes something in the comments or under the username  
or somewhere further that could break your SQL or some code to cause your app to accidentally do something that is not intended.

Then of course to prevent flood (so that someone doesn’t publish 100 lines in 5 seconds)  
and then request min.chars for the message as well as max  
so that someone doesn’t publish a book in one message and “crash” your chat/forum

And then disable sending curse words, and creating usernames like “admin, moderator, etc.”…

So it would be good if you make a config section  
in which you will keep all these settings and edit them through the GUI  
then either save it in a file or in the DB

---

<div class="post-metadata">

**Author:** ![userbung](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/userbung/32/39323_2.png) [@userbung](https://forum.infinityfree.com/u/userbung)\
**Post date:** [August 8, 2023, 6:14pm UTC](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210/40 "2023-08-08T18:14:35Z")

</div>

Nevermind, i cant get it to be server-side (its localhost) and infinityfree doesnt support node.js so i ended up just abandoning it

[Previous page](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210.md?page=1)

[Next page](https://forum.infinityfree.com/t/mysql-server-not-accepting-connections/80210.md?page=3)
