MYSQL 管理 技术教程文章

express链接mysql, 用数据库连接池管理链接【代码】【图】

1、在API的开发当中,数据库的处理显得尤为重要,express 工程 链接mysql数据库有很好的模板可以借鉴。 1.1 创建数据库链接 新建一个DB目录,在DB目录下新建文件 db.js 内容如下/*** Created by wjw on 2018/10/13.*/ //db.js // connect mySql var mysql = require(mysql); var pool = mysql.createPool({connectionLimit: 10,host: localhost,user: root,password: 0,database: testForApi});function query(sql, values, callb...

10 MySQL--权限管理【代码】

权限管理1、创建账号# 本地账号create user egon1@localhost identified by 123; # mysql -uegon1 -p123# 远程帐号create user egon2@192.168.31.10 identified by 123; # mysql -uegon2 -p123 -h 服务端ipcreate user egon3@192.168.31.% identified by 123; # mysql -uegon3 -p123 -h 服务端ipcreate user egon3@% identified by 123; # mysql -uegon3 -p123 -h 服务端ip2、授权user:*.*db:db1.*tables_priv:db1.t1columns_priv:...

MySql Database 用户与权限管理

创建用户 mysql> create user tpcc@% identified by tpcc; Query OK, 0 rows affected (0.02 sec)修改用户密码 mysql> set password for tpcc@%=password(abcd.1234); Query OK, 0 rows affected (0.03 sec)查询用户权限 mysql> show grants for tpcc@%; +-----------------------------------------------------------------------------------------------------+ | Grants for tpcc@% ...