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