Mysql user authorization, database permission management, SQL syntax details, mysql permission management
Mysql user authorization, database permission management, and SQL syntax-NiceCui
1. Authorize the primary SQL // ALL permissions of a database after ALL + PRIVILEGESGRANT ALL PRIVILEGES ON db_permit. * TO 'dev' @ '%' identified by 'yqwzh3e77srrpkms '; // No database permission for a specific database -*. * GRANT select, update, insert, delete ON db_permit. * TO 'dev' @ '%' identified by 'yqwzh3e77srrpkms '; // detailed description of authorization syntax SQL-GRANT-permission-ON 1. database Name. table Name (all *) 2. all databases *. * TO 'username' @ 'allowed ip addresses (all %) 'identified by 'user password'; 2: Other // permission refresh-after each permission adjustment, you usually need to execute the following statement to refresh the permission: flush privileges; // display the show grants authorization; // remove the authorized evke all privileges on *. * (Database Name or '*'-indicates all) FROM 'username '@ 'IP'; // Delete the created user drop user username @ localhost; // rename the user-'%' indicates all ipRENAME user' old Username '@' % 'to 'new name' @' % '; // change the password set password for 'username' @ 'IP' = PASSWORD ('123 ');