MySQL on Ubuntu can be accessed remotely

Source: Internet
Author: User

1. Does the 3306 port not open?

Use the Nestat command to view the 3306 port status:

~#  netstat-an | grep 3306

TCP 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

From the results, it can be seen that port 3306 is only listening on IP 127.0.0.1, so it denies access to other IPs.

Workaround: Modify the/etc/mysql/my.cnf file. Open the file and find the following:

# Instead of skip-networking The default is now-listen only on # localhost which are more compatible and are not less secure. Bind-address  = 127.0.0.1

Comment out the above line or replace the 127.0.0.1 with the appropriate IP.

After restarting, re-use netstat detection:

~#  netstat-an | grep 3306TCP        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN

2. Did you solve the problem?

Now test with the following command:

~#  mysql-h 10.1.1.2-u root-p1130 (00000): Host ' b0324-desktop.local ' is not allowed to Connect to this MySQL server

The result is unexpected, or not.

Workaround: It is also necessary to assign user rights to each remote user.

Log on to the MySQL server and use the grant command to assign permissions

Mysql> Grant all on database_name.* to [e-mail protected] '% ' identified by ' User_password ';

where database_name, user_name and User_password are set according to the actual situation.

After the completion of the use of the MySQL command connection, prompt success, in order to ensure that the correct can be remote landing test.

Transferred from: http://blog.csdn.net/mydeman/article/details/3847695

MySQL on Ubuntu can be accessed remotely

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.