MySQL总结(施工中.....)

order by:查询以某一特定顺序显示查询行,可以出现在select子句中的一列或多列对数据进行排序。

group by:分组浏览订单总量的平均值,当通过合计函数使用group子句的时候,实际上改变了该函数的行为。

having:跟在group子句后,测试一个合计的结果,类似于只用于分组与合计的where子句。

mysql_fetch_array():将数据以数字索引的方式存储在数组之中,并且可以将数据作为关联索引存储,用字段名作为键名。

MySQL赋予用户权限的命令的简单格式为
grant 权限 on 数据库对象 to 用户
grant 权限 on 数据库对象 to 用户 identified by "密码"
用户名:root,密码:root,登陆ip:xxx.xxx.xxx.xxx
//用户在所有登陆ip的权限
grant all on *.* to root@‘%’ identified by "root";
//开放管理MySQL中所有数据库的权限
grant all on *.* to root@'xxx.xxx.xxx.xxx' identified by "root";
//开放管理MySQL中具体数据库(db)的权限
grant all privileges on db to root@'xxx.xxx.xxx.xxx' identified by "root";
或grant all on db to root@'xxx.xxx.xxx.xxx' identified by "root";
//开放管理MySQL中具体数据库中的表(db.table1)的权限
grant all on db.table1 to root@'xxx.xxx.xxx.xxx' identified by "root"
//开放管理MySQL中具体数据库的表(db.table1)的部分列的权限
grant select(id,rank) on db.table1 to root@'xxx.xxx.xxx.xxx' identified by "root";
//开放管理操作指令
grant select,insert,update,delete on db.* to root@'xxx.xxx.xxx.xxx' identified by "root";
//回收权限
revoke all on *.* from root@localhost;
//查看MySQL用户权限
show grants;
show grants for root@localhost;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值