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)


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章