Access a MySQL Database in Electron

☆樱花仙子☆ 提交于 2019-12-12 07:50:03

问题


I am using Electron to create an app, and wanted to get to select and insert/update some table in a MySQL Database in my localhost, how can I make the connection with the Database ?

PS: I am very new to Electron

Thank you for your help.


回答1:


Electron is the combination of Chromium, the web renderer used in Chrome, and Node.js. Adding Node.js to the mix gives Electron the ability to work with the native OS in ways normal web pages cannot. With Node.js at your disposal you have access to all the libraries that are currently available to Node, and so the answer to this question is the same as the answer to how to connect to MySQL from Node.js which you can find here: MySQL with Node.js. The code in this answer should work in Electron.



来源:https://stackoverflow.com/questions/38391675/access-a-mysql-database-in-electron

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!