After installing mysql, enable remote Logon

Source: Internet
Author: User

Mysql is installed on the internal test server. It is okay to log on to the database locally on the server, but remote logon is not allowed. Try to use the telnet command to connect to the mysql server. The command line displays the following prompt:

Telnet 192.168.41.191 3306
Trying 192.168.41.191...
Connected to 192.168.41.191.
Escape character is '^]'.
G Host '192. 168.41.186 'is not allowed to connect to this MySQL serverConnection closed by foreign host.

At first, I suspected that the firewall port was not opened. I directly shut down the firewall.

Then I wonder if the router has set any rules for server access. No filtering rules are added to the vro. The problem should not be caused by the vro.

Later I found that mysql did not enable remote logon by default. It was so embarrassing that I was too ignorant.

Then you can find the method to enable remote logon. As follows:

Modify the localhost data of the host field of the mysql database table user to "%"
On the mysql Console, enter flush privileges
Commit

After completing these three steps, you can use the remote machine to log on to mysql again and connect to mysql.

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.