Setting up MySQL on Ubuntu can be accessed remotely

Source: Internet
Author: User

1. View the IP that the MySQL port allows access to.

netstat-an| grep 3306

If displayed as the following, only native access is allowed.

TCP        0      0127.0.  0.1:3306          0.0.  0.0:*               LISTEN

2, modify the/ETC/MYSQL/MYSQL.CONF.D/MYSQLD.CNF, will be inside the

127.0. 0.1

Comment out.

3, terminal login to MySQL, to all remote user authorization (the following two ways to choose one according to the actual situation).

3.1 Authorized for all remote users.

' Root  '@'%'123456'; #root为远程登录用户, 123456 is the password for the Telnet user

3.2 Authorized for the specified IP.

GRANT all privileges on * * to [email protected]' specified IP address 'root user password  ' with GRANT OPTION;

4. Restart MySQL.

/etc/init.d/mysql restart

5. Re-view the port.

#netstat-an|grep 3306TCP60      0:::3306:::*LISTEN TCP60      0 192.168.4.128:3306      192.168.4.1:53071ESTABLISHEDTCP60      0 192.168.4.128:3306      192.168.4.1:50004Established

Setting up 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.