给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)

 

Logo

更多推荐