MySQL的一些小操作之用户权限

给root用户授权,让root用户阔以从外部连接进来

mysql> grant all privileges on *.* to root@"%" identified by "123456";
Query OK, 0 rows affected (0.00 sec)

查看一下,确定一下用户以及阔以连接的host,已经变为%了,就阔以从外部连接了,我用的是navicate连接,如下图所示

mysql>  select user,host from mysql.user;
+------+-----------+
| user | host      |
+------+-----------+
| root | %         |
| root | 127.0.0.1 |
| root | ::1       |
| root | hobby     |
| root | localhost |
+------+-----------+
5 rows in set (0.01 sec)

发布了111 篇原创文章 · 获赞 31 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_24601199/article/details/104589651