Node.js connection to MySQL

Today there are some problems using node.js to connect to MySQL remotely. I hope this article can help those novices like me .
The following is the code to connect to the remote database. Insert picture description here
The code is right, then I can not connect the goose by Baidu see the need for it to create a new user permissions set
by ALL privileges ON GRANT . To "root" @ "%" IDENTIFIED BY 'password';
this on the right User empowerment is complete.
If you can connect here, you don’t need to look down
If it still doesn't work, set up your server security group. Please refer to the attached setting link here.
Tencent Cloud: Tencent Cloud server releases the external port number by setting the security group .
Alibaba Cloud: Talking about cloud server security group functions and usage

Guess you like

Origin blog.csdn.net/weixin_43889562/article/details/98218762