Open MySQL remote access feature in Ubuntu Linux

Source: Internet
Author: User

In order to give the server a real operating environment, today in the intranet deployment of an Ubuntu Linux server, the most headache is the installation of MySQL, apt download update speed is too slow, so they compiled the source of MySQL itself, Specific compilation method can refer to some of the information on the Internet, here only to start MySQL remote access function to do a simple story:

(1) Confirm that 3306 is open to the public, MySQL default state is not open to external access function. See the following:

Java code

~# Netstat-an | grep 3306

TCP 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

As can be seen from the above, the 3306 port of MySQL is only listening to local connections, which hinders the external IP access to the database, the method of modification is actually very simple, into the MySQL configuration file directory (/ETC/MYSQL/MY.CNF), find the following contents of the file:

Java code

# 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 bind-address or change it to the client host IP you want to use.

This way, if the remote access port of MySQL is turned on, there is a more important step to authorize the remote user.

(2) Confirm whether the client user has access rights.

In order to give access to the users of the MySQL client, we can authorize the user as follows:

Java code

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

The user rights granted by the above command can access any database and tables (table) in MySQL.

Complete the two steps above and restart MySQL to log on to the MySQL server remotely. The MySQL restart command is as follows:

Java code

Sudo/etc/init.d/mysql restart

Above is simply some introduction, can not package cure all diseases, the specific situation also need to according to their own operating environment to be determined, I hope to be helpful.

Open MySQL remote access feature in Ubuntu Linux

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.