Amazon EC2 ubuntu under install MySQL remote unable to connect problem O

Source: Internet
Author: User

There are many reasons for not being remote, and the problem I am experiencing today is that I cannot remotely connect to an instance I created on EC2 by Navicat.

1. Through the command "Netstat-an|grep 3306" check 3306 ports open to those addresses, I am here to modify, I modified the following red box marked out before the IP originally 127.0.0.1 caused by the inability to re-access external.

2. Modify the configuration file, many people on the net said to modify this file: Udo Vim/etc/mysql/mysql.conf.d/mysqld.cnf. Your sister! The baby has not found this file for half a day, OK!! Where's The pit Daddy??!!

Then I went through the MySQL directory and finally found the correct configuration file/etc/mysql/my.cnf

Through the command sudo vi my.cnf Edit, will 127.0.0.1 that line comment out, remember must use sudo edit, otherwise cannot modify this read-only file, modified after use command: wq! Force save exit.

3. Use the command sudo/etc/init.d/mysql restart to restart MySQL

4. Re-use Navicat remote connection

PS: If you are not connected, try to authorize the root user

1.mysql-u root-p

2.grant all privileges on * * to ' root ' @ '% ' identified by ' yourpwd ' with GRANT option;

If not yet ... Oh..

Amazon EC2 ubuntu under install MySQL remote unable to connect problem O

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.