Allow Ubuntu to connect remotely under MySQL

Source: Internet
Author: User

The first step:

Gedit/etc/mysql/my.cnf Found bind-address = 127.0.0.1

Comment out this line, such as: #bind-address = 127.0.0.1

or instead: Bind-address = 0.0.0.0

Allow any IP access;

Or specify an IP address yourself.

Restart Mysql:sudo/etc/init.d/mysql restart

Step Two:

Authorized users can connect remotely

Grant all privileges on * * to [email protected] '% ' identified by ' password ' with GRANT option;

Flush privileges;

The first line of the command is interpreted as follows, * *: The first * represents the database name, and the second * represents the table name. This means that all tables in the database are licensed to the user. Root: Grant root account. "%": indicates that the authorized user IP can be specified, which means that any IP address can access the MySQL database. "Password": Assign the password of the account, here the password itself is replaced with your MySQL root account password.

The second line of command is to refresh the permission information, that is, let our settings take effect immediately.

Allow Ubuntu to connect remotely under 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.