I'm trying to connect to the local MYSQL server, but I see this error:

Error: Access Denied for User 'root' @ 'Localhost' (using Password: YES)

everything works when I go through MySQL -U root -p And I enter the same password as via node.js.

There are some options, why can it be so?

Try specifying the host to connect And show the contents of the Mysql.user table

Anton Shchyrov2021-09-08 21:16:07

And show the code.

Alexey Ten2021-09-08 21:16:07