show grants for username@localhost;
//查看用户student1有哪些权限
select host,user from mysql.user;
//MYSQL环境下,查看当前有哪些用户
drop user '用户名'@'主机名';
//查看用户student1有哪些权限
revoke privileges on databasename.tablename from 'username'@'host';
//请将sc表select ,update权限从用户student1中收回
//将xskc库中的student 表的名字修改为student1
//在管理员账户下查看xskc数据库下有哪些数据表的命令
CREATE USER st_01@localhost IDENTIFIED BY'123456';
//在本地建一个student1的MYSQL用户,密码为12345
SET PASSWORD FOR st_01@localhost ='111111';
//修改用户student1的口令为abcdef (root来修改)
ALTER DATABASE 'xskc'
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci;
//如将xskc数据库编码方式修改为utf8形式:
grant select,update(cno),update(grade) on xskc.sc to 'student1'@'localhost' with grant option;
//请将sc表的浏览权限以及cno,grade 的修改权限授予student1用户,同时也将授予权权限授予student1(提示:本题目要加上本地服务器标志'localhost)
mysql
最新推荐文章于 2023-10-24 10:17:56 发布