Mysql Database Remote Connection open method _mysql

Source: Internet
Author: User
The first method: more detailed
The following article is mainly about the MySQL database to open the timing of remote connection operation process, in fact, open the MySQL database remote connection of the actual operation steps are not difficult, knowledge method right and wrong, today we want to describe the MySQL database to open the timing of remote connection operation process.

1, d:\mysql\bin\>mysql-h localhost-u root

This should allow access to the MySQL server
Copy Code code as follows:

Mysql>update User Set host = '% ' where user = ' root ';
Mysql>select host, user from user;

2. Mysql>grant all privileges in *.* to ' root ' @ '% ' identified by ' MyPassword ' with GRANT OPTION

Permission to access data to any host

3, Mysql>flush privileges

Change takes effect

4, Mysql>exit

Exit MySQL Server

This allows you to log in as root on any other host!

The above related content is the MySQL database to open the remote connection Introduction, hope you can have some harvest.

The second method:
1, in the console to perform mysql-u root-p MySQL, the system prompts you to enter the database root password, enter the completion of the MySQL console, the first MySQL is the command to execute, the second MySQL is the system data name, not the same.

2. Execute GRANT all privileges in MySQL console *.* to ' root ' @ '% ' identified by ' MyPassword ' with Grant OPTION;

3, in the MySQL Console Executive command of the ' root ' @ '% ' can be understood in this way: root is the user name,% is the host name or IP address, where the% represents any host or IP address, you can also replace any other user name or specify a unique IP address; ' MyPassword ' is the password for the login database specified by the authorized user; and the other thing that I have here is to authorize all permissions, you can specify partial permissions, grant specific operation details see: http://dev.mysql.com/doc/refman/5.1/en/grant.html

4, do not trust the words can be executed in the MySQL console select Host, user from user; Check the contents of the user's list
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.