Linux settings allow remote connection of MYQL database

Source: Internet
Author: User

System environment:

3.13. 0--generic #:x86_64 x86  _64 x86_64 Gnu/linux

MySQL has been installed in the system.

The first step , modify the configuration file,/etc/mysql/my.conf

Find bind-address = 127.0.0.1 This line and comment, as follows:

# # Instead of Skip-which more less secure.# bind-address       127.0. 0.1 #

After modifying, restart MySQL to make the configuration effective:

sudo /etc/init.d/mysql start

The second step is to authorize users to connect remotely

Grant  All Privileges  on *. *  to [Email protected] "%byprivileges;

The command line is interpreted as follows:

First line:

*. *: The first * represents the database, the second * represents the data table, *. * represents all the tables in all databases, and users can authorize specific databases according to their own application.

[email protected] "%": root for the root account authorization, "%" in the "%" can specify the user's ip,% means that any IP can be accessed.

"Password": is the account corresponding password, here is the root password

Second line:

Refresh authorization information to make authorization settings effective immediately

Linux settings allow remote connection of MYQL database

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.