How to solve the remote connection problem of ubuntu mysql

Source: Internet
Author: User


When opennebula 3.8 is configured today, when one start is started, an error indicating that the database cannot be connected is reported,
However, you can log on by entering mysql-uroot-p in shell, so the problem should be that mysql does not allow the root user to remotely
To solve the logon problem, run the following command:
Grant all privileges on *. * TO root @ "%" identified by 'Password' WITH GRANT
OPTION; after I restarted mysql, I found that I still couldn't connect. So I thought whether the firewall (ufw) or iptables disabled the port 3306.
Through service iptables stop and ufw status, it is not a firewall or iptables problem.
Netstat shows that port 3306 is in the listening status. After www.2cto.com ruled out the above factors, google again, and found that the problem occurs in the mysql configuration file my. cnf, through the following
Modify, restart mysql, and log on remotely. opennebula is connected to the mysql database.
Sudo vim/etc/mysql/my. cnf
// Locate the following content and comment out
Bind-address = 127.0.0.1 comment out bind-address = 127.0.0.1 and restart mysql! If you do not note
Release. You can see through netstat that port 306 only listens to the IP address 127.0.0.1, so access from other IP addresses is denied.

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.