javascript 如何将 node.js 连接到 mysql 和 wamp/xampp 服务器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31397638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to connect node.js to mysql and wamp/xampp server?
提问by Kaushik Das
I'm a PHP programmer and currently working with WP, CI, OC.
我是一名 PHP 程序员,目前与 WP、CI、OC 合作。
I am absolute beginner of node.js, want to know how to connect MySql and WAMP/XAMPP in step by step method.
我是 node.js 的绝对初学者,想知道如何一步一步地连接 MySql 和 WAMP/XAMPP。
If I am going to live it, then what will be the live server setup.
如果我要活下去,那么实时服务器设置将是什么。
Please let me know in step by step method.
请让我知道一步一步的方法。
回答by wuno
Follow this tutorial. Tutorial Here
按照本教程。 教程在这里
To use node.js you need to install the packet manager NPM
and use it to install the dependencies of your project.
要使用 node.js,您需要安装数据包管理器NPM
并使用它来安装项目的依赖项。
In the example tutorial I posted above hes uses NPM
to install all his dependencies to connect to mysql
just as you requested. He also provides sample code.
在我上面发布的示例教程中,他NPM
用来安装他的所有依赖项,以便mysql
按照您的要求进行连接。他还提供了示例代码。
Good luck!
祝你好运!
Here is another few tutorials you might follow, Click Here
这是您可能会遵循的其他一些教程,请 单击此处
This uses mongoDB instead of mysql but following this tut will help you get things running quicker then you can find something to help with mySQL.
这使用 mongoDB 而不是 mysql,但遵循这个 tut 将帮助您更快地运行,然后您可以找到帮助 mySQL 的东西。
After installing npm with the tutorial right above here and you check and make sure you have npm installed then follow this youtube tutorial to get mysql set up with node. And here is a youtube video. Click Here
使用上面的教程安装 npm 后,检查并确保已安装 npm,然后按照此 youtube 教程使用 node.js 设置 mysql。这是一个youtube视频。 点击这里
回答by phraniiac
It might help to use this package Node Mysql Package. Also you can find the resources in the answer to this question here.
使用这个包Node Mysql Package可能会有所帮助。您也可以在此处找到此问题的答案中的资源。