首页 > 技术文章 > mysql-添加用户

tangpg 2018-03-13 12:09 原文

查看用户及连接:

localhost 为本地连接

% 可远程连接

 

select user,host from mysql.user;

*1 创建用户
```
create user 'username'@'%' identified by 'password';
```
*2 赋权
```
grant all on *.* to 'username'@'%';
```
*3 刷新
```
flush privileges;

推荐阅读