标签:mysql基本
mysql> use mysql;
Database changed
mysql> select host,user from user where user="root";
+-----------+------+
| host | user |
+-----------+------+
| 127.0.0.1 | root |
| ::1 | root |
| localhost | root |
+-----------+------+
3 rows in set (0.02 sec)
mysql> Grant all on *.* to ‘root‘@‘10.3.0.4‘ identified by ‘root‘ with grant o
ption;Query OK, 0 rows affected (0.09 sec)
吧10.3.0.4替换成% 是所有IP允许登录
mysql> select host,user from user where user="root";
+-----------+------+
| host | user |
+-----------+------+
| 10.3.0.4 | root |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | root |
+-----------+------+
4 rows in set (0.00 sec)
标签:mysql基本
原文地址:http://8561563.blog.51cto.com/8551563/1854901