MySQL by default to turn off Telnet permissions, the following actions allow users to log in any location: 1. Enter mysql,grant all privileges on * * to ' root ' @ '% ' of ' identified by ' with the GRANT option;identified by followed by a password that can be set to null. 2. FLUSH privileges; Update MySQL for security, by default the user is allowed to log on locally only, but in this case, you still need to use the user for remote connection, so in order to make it possible to remotely need to do the following: First, allow the root user to remote login anywhere, and have all the library operation permissions, The operation is as follows: In this machine first use the root user login mysql:mysql-u root-p "Youpassword" for authorization operation: Mysql>grant all privileges on * * to ' root ' @ '% ' Identified by ' Youpassword ' with Grant OPTION; Overload authorization table: FLUSH privileges; exit MySQL database: Exit Two, allow the root user to telnet in a specific IP, and have all the library operation permissions, the following: In the local first use the root user login mysql:mysql-u root-p "Youpassword" for authorization operation: Grant all privileges on * * to[email protected]"172.16.16.152" identified by "Youpassword" with Grant OPTION; Overload authorization table: FLUSH privileges; exit MySQL database: Exit three, Allow the root user to remotely log on to a specific IP, and have all library-specific operations rights, as follows: In this computer first use the root user login mysql:mysql-u root-p "Youpassword" for authorization operation: Grant SELECT, Insert,update,delete on * * to[email protected]"172.16.16.152" identified by "Youpassword"; Overload authorization Table: FLUSH privileges; exit MySQL database: Exit four, remove user authorization, need to use the revoke command, The specific command format is: REVOKE privileges on database [. Table name] from User-name; The specific instance, first in the native login mysql:mysql-u root-p "Youpassword" to authorize the operation: Grant SELECT, Insert,update,delete on Test-db to[email protected]"172.16.16.152" identified by "Youpassword"; Delete authorization action: REVOKE all on test-db from test-user;**** Note: This action only clears the user's authorization rights for TEST-DB, but this "test-user" user still exists. Finally clear the user from the user table: DELETE from user WHERE user= "Test-user"; Overload authorization Table: FLUSH privileges; exit MySQL database: Exit five, MySQL permissions detailed classification: Global administrative permissions: FILE : Read and write files on the MySQL server. PROCESS: Displays or kills service threads belonging to other users. RELOAD: Overloads the Access Control table, refreshes the log, and so on. SHUTDOWN: Turn off the MySQL service. Database/data Table/Data column permissions: Alter: Modifies an existing data table (for example, add/Remove Columns) and index. Create: Create a new database or data table. Delete: Deletes the record for the table. Drop: Deletes a data table or database. Index: Establish or delete the indexes. INSERT: Adds a table record. SELECT: Displays/searches the table's records. UPDATE: Modifies a record that already exists in the table. Special permissions: All: Allow to do anything (as root). USAGE: Only allow login-nothing else is allowed. This article from Csdn Blog, reproduced please indicate the source: http://blog.csdn.net/zhengnz/archive/2011/04/08/6308773.aspx
MySQL Remote login permission setting allows Navicat to remotely connect to the server's database