Telnet MySQL appears: is not allowed to connect to this MySQL serverconnection closed by foreign host problem resolution

Source: Internet
Author: User
Tags mongodb postgresql



Sometimes when you telnet to a MySQL server, it appears:

Host ' 192.168.0.1 ' isn't allowed to connect to this MySQL serverconnection closed by foreign host.

This is because the MySQL database requesting the link only allows the server on which it resides, and it needs to set the allowed IP rights on the MySQL server as follows:


connection command side:




1. Connect to MySQL


Mysql-u root-p







2. Authorization


Grant all privileges on * * to ' root ' @ ' 192.168.0.1 ' identified by ' 123456 ';








Of course, if you want to give permissions to all IPs, this is the case:




Grant all privileges on * * to ' root ' @ '% ' identified by ' 123456 ';
3. Immediate entry into force of the mandate


Flush privileges;








Then telnet remotely or connect to the MySQL database to succeed.





Reference



Telnet MySQL appears: is not allowed to connect to this MySQL serverconnection closed by foreign host problem resolution


Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.