admin管理员组文章数量:1026192
I have a javascript application running with server like nginx
or eclipse local server
, and i would like to know if it is possible to connect it with mysql server database.
I know that they are a lot of npm packages
for nodejs
application, but i don't want to use node js because if i'll do that i have to implement all structure of nodejs application with all dependencies and i don't know very well this technology to do that.
Thanks.
I have a javascript application running with server like nginx
or eclipse local server
, and i would like to know if it is possible to connect it with mysql server database.
I know that they are a lot of npm packages
for nodejs
application, but i don't want to use node js because if i'll do that i have to implement all structure of nodejs application with all dependencies and i don't know very well this technology to do that.
Thanks.
Share Improve this question edited Dec 29, 2015 at 17:07 CodeWizard 143k22 gold badges160 silver badges180 bronze badges asked Dec 29, 2015 at 17:06 shmoolkishmoolki 1,5619 gold badges35 silver badges58 bronze badges1 Answer
Reset to default 5There is no way to connect to a remote database server directly from JavaScript running in a browser… and if there was it would probably involve a huge security hole since anyone with access to the client could take your credentials and run any SQL they like on the server. It is unlikely you could make your database GRANTS fine-grained enough for public consumption.
If you want your client side JS to interact with your database server then you need to write a webservice for it. You can do that in Node.JS or any other server side environment you like.
If you are using Node.JS then you will probably want Nginx to proxy the requests.
Nginx supports FastCGI so you could write in any language that supports FastCGI such as Perl or PHP.
I have a javascript application running with server like nginx
or eclipse local server
, and i would like to know if it is possible to connect it with mysql server database.
I know that they are a lot of npm packages
for nodejs
application, but i don't want to use node js because if i'll do that i have to implement all structure of nodejs application with all dependencies and i don't know very well this technology to do that.
Thanks.
I have a javascript application running with server like nginx
or eclipse local server
, and i would like to know if it is possible to connect it with mysql server database.
I know that they are a lot of npm packages
for nodejs
application, but i don't want to use node js because if i'll do that i have to implement all structure of nodejs application with all dependencies and i don't know very well this technology to do that.
Thanks.
Share Improve this question edited Dec 29, 2015 at 17:07 CodeWizard 143k22 gold badges160 silver badges180 bronze badges asked Dec 29, 2015 at 17:06 shmoolkishmoolki 1,5619 gold badges35 silver badges58 bronze badges1 Answer
Reset to default 5There is no way to connect to a remote database server directly from JavaScript running in a browser… and if there was it would probably involve a huge security hole since anyone with access to the client could take your credentials and run any SQL they like on the server. It is unlikely you could make your database GRANTS fine-grained enough for public consumption.
If you want your client side JS to interact with your database server then you need to write a webservice for it. You can do that in Node.JS or any other server side environment you like.
If you are using Node.JS then you will probably want Nginx to proxy the requests.
Nginx supports FastCGI so you could write in any language that supports FastCGI such as Perl or PHP.
本文标签: Connect to MySQL in javascript server side without nodejsStack Overflow
版权声明:本文标题:Connect to MySQL in javascript server side without node.js - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745622625a2159668.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论