mysql 的触发器和授权

来源:互联网 发布:笔记本插着网线没网络 编辑:程序博客网 时间:2024/06/05 00:17

菜鸟一枚,欢迎大家指点哦

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

接下来就可以使用授予的权限了……

  

 

原创粉丝点击