mysql创建用户授权

mysql> create user sun1@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'sun1'@'%'=password('123');
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to 'sun1'@'%';
Query OK, 0 rows affected (0.00 sec)


mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

 

mysql中创建用的"%"是否包含localhost

网络摘自:

版本用户中的%是否包括localhost
MySQL8.0 包括
MySQL5.7 包括
MySQL5.6 不包括
MySQL5.1 不包括
MariaDB 10.3 不包括
posted on 2019-06-20 21:33  Shawn_1026  阅读(983)  评论(0编辑  收藏  举报