Access a MySQL Database in Electron

后端 未结 1 927
时光取名叫无心
时光取名叫无心 2021-02-13 22:22

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 Databa

1条回答
  •  攒了一身酷
    2021-02-13 22:33

    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.

    0 讨论(0)
提交回复
热议问题