1.CREATE USER 'yangxiaohui'@'192.168.56.10' IDENTIFIED BY 'yangxiaohui'; -- 创建一个用户,192.168.50.10 指得是只有这个ip地址才能登录 如果是允许所有用户登录使用%,如果指定某段ip:192.168.56%
2. drop user 'yangxiaohui'@'192.168.56.10';-- 删除用户和授权
3. grant select, insert, update, delete on shop.* to yangxiaohui@'192.168.56.10'; -- 授权用户访问某个库的权限
4. grant all privileges on *.* to 'yangxiaohui'@'192.168.56.10' ;-- 授予所有权限
5. flush privileges; -- 刷新一下授权
6. 查看某个用户拥有的权限:show grants for 'yangxiaohui'@'192.168.56.*'
7.用户的信息存在:
8. 查询有哪些连接在执行:show processlist
9. mysql 登录:
mysql ‐h host[数据库地址] ‐u root[用户] ‐p root[密码] ‐P 3306