菜鸟一枚,欢迎大家指点哦
create database that;
use that;
create create table student(sno numeric(6) primary key, sname char(10) );
insert into student values (100001,'chen');
insert into student values(100002,'wang');
delimiter //;
create trigger update_student
before update on student for each row
begin
update student set sname=null ;
end //;
update student set sname=''ton' where sno=100001;
select * from student;
grant select ,update on that.student to nuser@localhost identified by 'good';
///nuser is a new user's name,the user will visite mysql. good is the password for
the new user//
在CMD命令行中进行如下操作
cmd
C:/Program Files/MySQL/MySQL Server 5.5/bin
(找到MYSQL的BIN 目录)显示为:
C:/Program Files/MySQL/MySQL Server 5.5/bin>
(put in )
mysql -h localhost -u nuser -p
(show)
Enter password:
(put in)
good
接下来就可以使用授予的权限了……
最后
以上就是背后小馒头最近收集整理的关于mysql 的触发器和授权的全部内容,更多相关mysql内容请搜索靠谱客的其他文章。
发表评论 取消回复