用法: 有两个用户:user1和user2,都是在库TEST上,分别有表user1.table1,user2.table2 但是用user1登录的时候,user2上表就不能用,此时就可以使用grant命令了: GRANT privilege [, ...] ON object [, ...] TO { PUBLIC | GROUP group | username } 如 grant insert,update,delete on user2.bable2 to user1 此时,u…
1.新建用户 新建用户: create User username Identified by password 修改用户密码: alter User username Identified by password 删除用户密码: drop user user_name [cascade] (cascade:级联删除选项,如果用户包含数据库对象,则必须加 CASCADE选项,此时连同该用户所拥有的对象一起删除.) [注意]: ①只有有DBA权限的用户才能新建用户: ②username :用户名.…
1.创建用户 create user guest_test@localhost identified by "root";-- 创建名为guest_test的用户 2.赋予权限 -- 给guest_test用户赋予guest_test增删改的权限.第一个guest_test指数据库,第二个指用户名,hostname指指定ip grant create,alter,drop on guest_test.* to guest_test@localhost -- 给guest_test用户赋…
1.新建个用户 create user xxxxx(用户名) identified by "密码" alert user 用户名 identified by “新密码” --修改用户密码 因为新建的用户和默认的用户是锁住的,没有权限.所以新建用户后要给用户赋予权限 grant dba to 用户名 --给用户赋予所有权限,connect是赋予连接数据库的权限,resource 是赋予用户只可以创建实体但是没有创建数据结构的权限. grant create session to 用户名…
添加用户: create user 'gouge'@'localhost' identified by 'gouge'; 赋予权限: 给gouge 用户赋予所有test开头的数据库权限 (test% 代表已test开头的数据库,如果指定单个数据库去掉%即可) grant select,insert,update,delete,create,drop,alter on `test%`.* to 'gouge'@'%' identified by 'gouge'; FLUSH PRIVILEGES;…
1.创建新用户 'xiaoxiao'密码'123456' mysql> CREATE USER 'xiaoxiao'@'localhost' IDENTIFIED BY '123456'; 2.问题:Navicat使用xiaoxiao链接,看不到新建的数据库testDB怎么办? //用户添加使用testDB权限 grant all privileges on testDB.* to xiaoxiao@localhost identified by '123456'; 3.为xiaoxiao用户添…