Connect MySQL and run the following command:
The code is as follows |
Copy Code |
Mysql-u root-p Mysql>use MySQL; Mysql>select host from user where user= ' root '; Mysql>update User Set host = '% ' where user = ' root '; Mysql>flush privileges; Mysql>select ' host ' from user where user= ' root '; |
Note: "Semicolons" behind some commands are not missing!
The first sentence is to log on with the permission user root
Second sentence: choose MySQL Library
The third sentence: View the host value of the user table in the MySQL library (the hosts/IP name for connection access)
Modify host value (increase host/IP address in the content of the wildcard character%), and of course add IP address directly
Refreshing MySQL's system permissions related tables
Sixth: When you view the user table again, there are changes ...
Restart the MySQL service to complete: service mysqld restart
On the action method in Liunx, here's a summary of Windows methods
1, enter MySQL, create a new user xuys:
Format: Grant permission on database name. Table name user @ Login host identified by "User password";
The code is as follows |
Copy Code |
Grant Select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234";
|
View the results and execute:
The code is as follows |
Copy Code |
Use MySQL; Select Host,user,password from user;
|
You can see that the Xuys user that you just created is already in the user table. The Host field indicates which hosts are logged on, their values can be IP, and are available
Host name,
Changing the value of the host field to% indicates that the Xuys user can log on to the MySQL server on any client machine, and it is recommended that
Set to%.
code is as follows |
copy code |
|
code is as follows |
copy code |
update user set host = '% ' where user = ' Xuys '; ./mysqladmin-uroot-ppwd Reload ./mysqladmin-uroot-ppwd shutdown ./mysqld_safe--user=root |
Remember that any modifications to the authorization table need to be reload, that is, to perform step 3rd.
If you cannot connect from the client through the above 3 steps, insert a record in the DB table of the MySQL database by doing the following
The code is as follows |
Copy Code |
Use MySQL; INSERT INTO DB VALUES (' 192.168.88.234 ', '% ', ' xuys ', ' y ', ' y ', ' y ', ' y ', ' y ' ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y-axis ', ' y ', ' y '; Update db Set host = '% ' where user = ' Xuys '; |
Repeat the 2nd and 3 steps above.
IDE tools more convenient, in the EMS MySQL, you can add a remote access to the user can be added, the host to fill in the% on it, and then select the following permissions list
Related reference documents
Http://www.111cn.net/database/mysql/34989.htm