The first method: more detailed
The following article mainly introduces the MySQL database to open the time of the remote connection operation process, in fact, the actual operation of the remote connection to the MySQL database is not difficult, the knowledge method is wrong, today we want to describe the MySQL database to open the time of the remote connection operation process.
d:\MySQL\bin\>--
This should allow access to the MySQL server
mysql> update user set host = " % " where user = " root " Span style= "COLOR: #000000" >; MySQL > select host, user from user ;
MySQL>GRANTallprivilegeson*. * to ' Root '@ '%' by'mypassword' with GRANT OPTION
Permission to access data to any host
3.
MySQL>Privileges
Changes take effect
4, Mysql>exit
Log out of MySQL server
This will allow you to log in as root on any other host!
The above related content is the MySQL database to open the remote connection of introduction, hope you can have some gains.
The second method:
1, in the console to perform mysql-u root-p MySQL, the system prompts for the password of the root user of the database, entered after the completion of the MySQL console, the first command of MySQL is to execute the command, the second MySQL is the system data name, not the same.
2. On the MySQL console execute GRANT all privileges on * * to ' root ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
3, in the MySQL console execution command of ' root ' @ '% ' can understand: 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; Another thing to note is that I am here to authorize all permissions, you can specify some permissions, grant specific operation details see: http://dev.mysql.com/doc/refman/5.1/en/grant.html
4, do not rest assured that you can execute the select Host in the MySQL console, user from user; Check the contents of the user table
MySQL Database remote Connection open method