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