MySQL: reading initial communication packet solution

Source: Internet
Author: User

One solution:

If an error occurs during Website access, check my. cnf: It is found that innodb_buffer_pool_size = 2048 M is too large and can be adjusted to innodb_buffer_pool_size = 1024M. There are other solutions to this problem on the Internet, but none of them can solve my problem.

Lost connection to MySQL server at 'reading initial communication packet'

I solved this problem last time. Today I encountered another problem. I suddenly lost my memories and finally got it done after I did some useless work. This time, I must record it to avoid wasting time next time.

1. Modify the mysql configuration file

Vi/etc/my. cnf

[Mysqld] segment and skip-name-resolve

Before that, you need to enable the remote access permission of mysql, or add the skip-grant-table (not recommended)

2. Modify hosts. allow

Vi/etc/hosts. allow

Add mysqld: ALL: ALLOW
Mysqld-max: ALL: ALLOW

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.