Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Remote login to mysql5.7 server

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

My remote login system is Mac os.

NancylulululudeMacBook-Air:bin nancy$ mysql-h 172.16.158.132-u root-p

Enter password:

ERROR 2003 (HY000): Can't connect to MySQL server on '172.16.158.132' (61)

Can communicate with ping

NancylulululudeMacBook-Air:bin nancy$ ping 172.16.158.132

PING 172.16.158.132 (172.16.158.132): 56 data bytes

64 bytes from 172.16.158.132: icmp_seq=0 ttl=64 time=1.361 ms

64 bytes from 172.16.158.132: icmp_seq=1 ttl=64 time=1.622 ms

64 bytes from 172.16.158.132: icmp_seq=2 ttl=64 time=0.399 ms

It should be the port.

Log in to MySQL server

View mysql port

[root@nancycici src] # netstat-apn | grep 3306

Tcp6 0 0: 3306: * LISTEN 36866/mysqld

View Port Firewall

[root@nancycici src] # firewall-cmd-- query-port=3306/tcp

No

Modify Port

[root@nancycici src] # firewall-cmd-zone=public-add-port=3306/tcp-permanent

Success

[root@nancycici src] # firewall-cmd-- query-port=3306/tcp

No

Reload

[root@nancycici src] # firewall-cmd-- reload

Success

[root@nancycici src] # firewall-cmd-- query-port=3306/tcp

Yes

Client logged in successfully

NancylulululudeMacBook-Air:bin nancy$ mysql-h 172.16.158.132-u root-p

Enter password:

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 24

Server version: 5.7.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, 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.

-D login database

Mysql-h 172.16.158.132-D nancyuser-u root-p

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report