mysql创建用户权限语法
create database testdb; /* 创建数据库 */
use testdb; /* 打开数据库 */
/*grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利*/
grant select,insert,update,delete on testdb.* to common_user@'%';
grant select,insert,update,delete on testdb.* to common_user@'localhost';
/* (.*代表所有表) @后的%代表所有用户,本地,远程都可以通过网络访问,@localhost,@'192.168.1.101' 加密identified by '123' */
/* grant 数据库开发人员,创建表、索引、视图、存储过程、函数。。。等权限 */
grant create,alter,drop on testdb.* to common_user@localhost; /* grant 创建、修改、删除 MySQL 数据表结构权限。 */
grant references on testdb.* to common_user@localhost; /* grant 操作 MySQL 外键权限 */
grant create temporary tables on testdb.* to common_user@localhost; /* grant 操作 MySQL 临时表权限 */
grant index on testdb.* to common_user@localhost; /* grant 操作 MySQL 索引权限 */
grant create view on testdb.*to common_user@localhost; /* 操作 MySQL 视图、查看视图源代码 权限 */
grant show view on testdb.* to common_user@localhost;
/* grant 操作 MySQL 存储过程、函数 权限 */
grant create routine on testdb.* to common_user@localhost;
grant alter routine on testdb.* to common_user@localhost;
grant execute on testdb.* to common_user@localhost;
flush privileges;
相关文档:
昨天为一个项目做数据库,项目涉及到订单,在设计数据库字典的时候 就把这个表名定为了order,建表的时候怎么建都不对,提示是表名附近出现问题,当时觉得不可能啊 也许是字段类型哪儿出了问题,查了好久,试了好几次,还是不行,后来突然恍然大悟,order by是排序语句,order肯定是保留字,怎么可能做表名呢。。。立即把表 ......
虽然很多人用mysql front, 但是个人觉得mysql还是命令行下比较好用,毕竟数据库在命令行下操作比较王道而且mysql完全免费。。
下面介绍一些mysql命令行下常用的命令,有一些数据库基础的,即使是第一次用mysql对照下面的命令操作也完全可以,如果我发现还有其它命令也是经常用到的我会陆续更新。。。
服务器:
1. 启动m ......
mssql,oracle中
test表:
1 5 abc
2 6 bcd
1 7 ade
2 8 adc
select a,b,c
from(
select a,b,c
,row_number()over(partition by a order by b desc) rn
from test
) &nb ......
数据同步问题终于解决:
转帖:A服务器: host 192.168.1.101 port 3306 B服务器: host 192.168.1.102 port 3306 1,授权用户: A服务器 mysql>grant replication slave,file on *.* to 'repl9'@'192.168.1.102' identified by '1234569'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Qu ......
[原创] MySQL数据库存储引擎和分支现状
在MySQL经历了2008年Sun的收购和2009年Oracle收购Sun的过程中,基本处于停滞发展的情况,在可以预见的未来,MySQL是肯定会被Oracle搁置并且逐步雪藏消灭掉的。MySQL随着相应的各主创和内部开发人员的离去,缔造了各个不同的引擎和分支,让MySQL有希望继续发扬光大起来。
本 ......