MySQL Database remote Connection open method

Source: Internet
Author: User

The first method: more detailed
The following article is mainly about the MySQL database to open the time of the remote connection operation process, actually open the mysql database remote Connection Practical steps is not difficult, the knowledge method is wrong, Today we are going to describe the timing of the MySQL database to open a remote connection .

1. D:\mysql\bin\>mysql -h localhost-u Root

This should allow access to the MySQL server

Copy CodeThe code is as follows:
MySQL>update User Set host = '% ' where user = ' root ';
MySQL>select host, user from user;


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

Permission to access data to any host

3.MySQL>flush Privileges

Changes take effect

4.MySQL>exit

ExitMySQLServer

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

The above related content is theMySQLDatabase OpenRemote ConnectionThe introduction, hope you can have something to gain.

The second method:
1. Perform in the consoleMySQL-U root-pMySQL, the system prompts for the password of the root user of the database and enters when the input is completed.MySQLConsole, the first of this commandMySQLis to execute the command, the second oneMySQLis the system data name, not the same.

2, inMySQLConsole execution GRANT all privileges on * * to ' root ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;

3, inMySQLThe ' root ' @ '% ' in the console execution command can be understood as: Root is the user name,% is the hostname or IP address, the% here represents any host or IP address, and you can replace any other user name or specify a unique IP address; ' MyPassword ' is the password for the login database specified by the authorized user; Another point is that I am here to authorize all permissions, you can specify some permissions, grant details see: Http://dev.MySQL. com/doc/refman/5.1/en/grant.html

4, do not rest assured that the words can beMySQLConsole execution Select Host, user from user; Check the contents of the user's table.

MySQL Database remote Connection open method

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.