sql权限
sql权限:
创建User:
insert into mysql.user(Host,User,Password)
values("localhost","cordev",password("xasoftorg"));
insert into
mysql.user(Host,User,Password)
values("localhost","corhotfix",password("xasoftorg"));
insert into
mysql.user(Host,User,Password)
values("localhost","corint",password("xasoftorg"));
赋予权限:
grant
all privileges on cordev.* to cordev identified by 'xasoftorg';
grant
all privileges on corhotfix.* to corhotfix identified by 'xasoftorg';
grant
all privileges on corint.* to corint identified by 'xasoftorg';
刷新:
flush
privileges;
用户权限
设置
1、以root(也可用其它有权限的用户)身份登录
2、
下面创建一个test用户,密码为test,并且只能对picture数据库进行操作的命令
mysql>GRANT ALL ON
picture.* TO test IDENTIFIED BY "test";
GRANT语句的语法看上去像这样:
GRANT privileges (columns) ON what TO user IDENTIFIED BY "password"
WITH GRANT OPTION
要使用该语句,你需要填写下列部分:
privileges
授予用户的权限,下表列出可用于GRANT语句的权限指定符:
权限指定符 权限允许的操作
Alter
修改表和索引
Create 创建数据库和表
Delete 删除表中已有的记录
Drop 抛弃(删除)数据库和表
INDEX 创建或抛弃索引
Insert 向表中插入新行
REFERENCE 未用
Select 检索表中的记录
Update 修改现存表记录
FILE 读或写服务器上的文件
PROCESS 查看服务器中执行的线程信息或杀死线程
RELOAD
重载授权表或清空日志、主机缓存或表缓存。
SHUTDOWN 关闭服务器
ALL 所有;ALL
PRIVILEGES同义词
USAGE 特殊的“无权限”权限
添加系统用户:
adduser
oracle
passwd oracle
solar:/home# rm -r oracle
solar:/home# cp
-r mhung oracle
solar:/home# chown -R oracle oracle
solar:/home#
rm -r oracle
solar:
相关文档:
.errInfo
{
border:solid 1px #d00;
background:#F7F0F7;
}
1.URL地址防注入:
//过滤URL非法SQL字符
var sUrl=location.search.toLowerCase();
var sQuery=sUrl.substring(sUrl.indexOf("=")+1);
re=/select|update|delete|truncate|join|union|exec|insert|drop|count|&r ......
---一个月的第一天
SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
--- 本周的星期一
SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
---一年的第一天
SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
----季度的第一天
SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)
----上个月的最后一天
......
行列转换
create table test(id int,name varchar(20),quarter int,profile int)
insert into test values(1,'a',1,1000)
insert into test values(1,'a',2,2000)
insert into test values(1,'a',3,4000)
insert into test values(1,'a',4,5000)
insert into test values(2,'b',1,3000)
insert into test values(2, ......
SQL中round()函数用法
SQL round()详解
round有两个重载,一个有带有两个参数的,一个是带有三个参数的,
每一个参数都相同是要处理的数,
1.带有两个参数.每二个参数是小数点的左边第几位或右边第几位,分别用正负表示.左边为负,右边为负.为四舍五入.
select round(748.585929,-1) 750.000000
select round(748.58592 ......