首页 > 科技 > mysql无法远程登录

mysql无法远程登录

2014年6月4日 14点47分

安装好mysql后,远程无法登录:

phillip@Barcelon:~$ mysql -h 172.16.70.101 -u root -p
Enter password: 
ERROR 1130 (HY000): Host '172.16.30.143' is not allowed 
to connect to this MySQL server

登录mysql主机,修改权限:

# mysql -u root -p
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
mysql>FLUSH PRIVILEGES

然后再次尝试在远程登录, 可以成功登录。

phillip@Barcelon:~$ mysql -h 172.16.70.101 -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. 
All rights reserved

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;'or '\h' for help. Type '\c' to clear the current input statement

mysql>
分类: 科技 标签:
本文的评论功能被关闭了.