我正在编写一个Node.js应用程序。在我的node-modules/abc/static/example.js文件中,我希望通过查询数据库来访问mysql记录。是否可以这样做呢?
当我像这样包括mysql时:
var mysql = require('mysql');
我收到一个错误:
未定义未定义的ReferenceError:要求
是因为它在客户端吗?从“example.js”文件访问mysql数据库的其他选项有哪些?
我如何知道哪些MySQL用户有访问数据库的权限,以及他们拥有哪些特权?
当我点击“特权”时,我似乎能够从phpMyAdmin获得这些信息。。。
Users having access to "mydatabase"
User Host Type Privileges Grant
myuser1 % database-specific ALL PRIVILEGES Yes
root localhost global