Host ' XXX ' isn't allowed to connect to this MySQL server solution/How to turn on MySQL remote account

Source: Internet
Author: User

How to open a MySQL remote account-1) first log in to MySQL with the root account

In the Windows Host, click Start menu, Run, enter "cmd", enter the console, then CD into the MySQL bin directory, and then enter the following command. > mysql-uroot-p123456 (123456 is the root user's password.) )

How to turn on MySQL remote account-2) Create a remote login user and authorize > Grant all privileges on test_db.* to [email protected]' 192 .168.1.101 ' identified by ' 123456 ';

The above statement indicates that all permissions to the TEST_DB database are granted to root, allowing the root user to remotely log on to the 192.168.1.101 IP and set the root user's password to 123456.

All parameters are analyzed below:

All privileges means giving all permissions to the specified user, which can also be replaced by assigning a specific permission, such as Select,insert,update,delete,create,drop, to be separated by a "," half-width comma between specific permissions.

Test_db.* means that the above permissions are for which table, test_db refers to the database, followed by the * for all tables, it can be inferred that: for all of the database is authorized as "*. *" For all tables, the entire table for a database is authorized as "database name. *", A table for a database is authorized as the database name. Table name.

Root indicates which user you want to authorize, and the user can be either an existing user or a non-existent user.

192.168.1.101 represents the IP address that allows remote connections, or "%" if you want to limit the IP of the link.

123456 is the user's password.

How to open the MySQL remote account-3) After executing the above statement, then execute the following statement before it takes effect immediately. > Flush Privileges;

Host ' XXX ' isn't allowed to connect to this MySQL server solution/How to turn on MySQL remote account

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.