Ways to allow remote users to log in to access MySQL

Source: Internet
Author: User
You need to manually increase the number of users who can access the database remotely.

Method one, log in to MySQL locally, change the "host" entry in the "User" table in the "MySQL" Database, and replace "localhost" with "%"

#mysql-U root-proot
Mysql>use MySQL;
Mysql>update User Set host = '% ' where user = ' root ';
Mysql>select host, user from user;
Method two, direct authorization (recommended)

To use the root user from any host, password: youpassword (your root password) to connect to the MySQL server:

# mysql-u Root-proot
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;

After the operation, remember to perform the following command refresh permissions

FLUSH Privileges

Ways to allow remote users to log in to access 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.