mysql用户

1.创建用户

    

--创建用户
--格式:用户名@ip地址
--备注:'% 中的 '表示转义 ,%相当于like '%' 匹配所有地址

create user 'test2'@'%' identified by 'mima';
 

 2.查看用户

    

--查看用户
select user,host from mysql.user;
+-------+-----------+
| user  | host      |
+-------+-----------+
| test1 | %         |
| test2 | %         |
| root  | 127.0.0.1 |
| root  | ::1       |
|       | localhost |
| root  | localhost |
+-------+-----------+

    3.查看用户权限

       

show grants for test2;
| GRANT USAGE ON *.* TO 'test2'@'%' IDENTIFIED BY PASSWORD '*98703F7A543944FD3818077669F74D60616DB2C8' |

--备注:*.*  表示  所有库.所有表

猜你喜欢

转载自flyouwith.iteye.com/blog/2268046