在尝试从客户端体系衔接长途mysql服务器时,我们常常碰到下面的题目,长途客户端不许可接见这个mysql服务器,以下所示。
# mysql -h 192.168.1.10 -u root -p Enter password: [Output] ERROR 1130 (HY000): Host '192.168.1.12' is not allowed to connect to this MySQL server
这个题目是因为,假如客户机体系没有衔接mysql服务器的权限。默许情况下,mysql服务器不许可任何长途客户端衔接。
(相干引荐:MySQL教程)
许可MySQL客户端衔接:
许可客户端体系衔接mysql服务器。先运用ssh登录长途mysql服务器,然后在当地登录mysql服务器。如今运用以下敕令来许可长途客户端。比方,假如长途客户端的IP是192.168.1.12,并尝试经由过程MySQL root帐户举行衔接。
[以下敕令需要在mysql服务器上运转]
# mysql -u root -p Enter password: mysql> GRANT ALL ON *.* to root@'192.168.1.12' IDENTIFIED BY 'new-password'; mysql> FLUSH PRIVILEGES; mysql> quit
已在MySQL服务器中胜利建立新帐户以从指定的客户端体系举行衔接。
让我们尝试从客户端体系衔接。
# mysql -h 192.168.1.10 -u root -p [Sample Output] Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 27 Server version: 5.1.69 Source distribution Copyright (c) 2000, 2013, 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>
本篇文章到这里就已悉数完毕了,更多其他精彩内容能够关注ki4网的其他相干栏目教程!!!
以上就是怎样许可长途客户端衔接MySQL服务器的细致内容,更多请关注ki4网别的相干文章!