Describe the situation, there is a database Xiyouzyadlog with sync authorization  , and the result I authorize the time authorized to xiyoumaintxzyandroid all rights, cause sync User login can see all the database, So delete sync user results after sync login still can see all the database including MySQL, and then Baidu view MySQL authorization, results appear below the result, below demonstrates how to delete the unused authorization information mysql> show grants for [email protected] ' localhost '; +------------------------------------------------ -------------------------------------------------------------+| grants for [email protected] |+------------------------------ -------------------------------------------------------------------------------+| grant usage on *.* to ' sync ' @ ' localhost ' IDENTIFIED BY PASSWORD ' *b805e12e6933ff815f344d9f4b0d7236b223dc86 ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' Xiyoumaintxzyandroid ' .* to ' sync ' @ ' localhost ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' Xiyouzyadlog ' .* to ' sync ' @ ' localhost ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' MySQL '. ' Xiyouzyadlog ' TO ' sync ' @ ' localhost ' |+--- ----------------------------------------------------------------------------------------------------------+ Remove useless authorization information RevokE select, insert, update, delete, create, drop on xiyoumaintxzyandroid .* from [email protected];mysql> show grants for [email Protected] ' localhost '; +--------------------------------------------------------------------------------------- ----------------------+| grants for [email protected] |+------------------------------------------------------------------------------ -------------------------------+| grant usage on *.* to ' sync ' @ ' localhost ' IDENTIFIED BY password ' *b805e12e6933ff815f344d9f4b0d7236b223dc86 ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' Xiyouzyadlog ' .* to ' sync ' @ ' localhost ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' MySQL '. ' Xiyouzyadlog ' TO ' sync ' @ ' localhost ' |+--- ----------------------------------------------------------------------------------------------------------+3 rows in set (0.00 sec) mysql> Remove useless authorization information revoke select, insert, update, delete, create, drop on mysql.xiyouzyadlog from [email Protected];mysql> show grants for [email protected] ' localhost '; +--------------------------------------------------- ----------------------------------------------------------+| grants for [email protected] |+------------------------------------------ -------------------------------------------------------------------+| grant usage on *.* TO ' sync ' @ ' localhost ' IDENTIFIED BY PASSWORD ' * B805e12e6933ff815f344d9f4b0d7236b223dc86 ' | | &nbsP grant select, insert, update, delete, create, drop on ' Xiyouzyadlog '. * TO ' sync ' @ ' localhost ' |+------------------------------------------------------------------------------------------ -------------------+2 rows in set (0.00 sec) mysql> mysql> show Grants for [email protected] ' 192.168.15.% '; +--------------------------------------------- -------------------------------------------------------------------+| grants for [email protected]% |+------------------------------------------------ ----------------------------------------------------------------+| grant usage on *.* TO ' sync ' @ ' 192.168.15.% ' IDENTIFIED BY PASSWORD ' * B805e12e6933ff815f344d9f4b0d7236b223dc86 ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' Xiyoumaintxzyandroid ' .* to ' sync ' @ ' 192.168.15.% ' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON ' Xiyouzyadlog ' .* to ' sync ' @ ' 192.168.15.% ' | | grant select, insert, update, delete, create, drop on ' MySQL '. ' Xiyouzyadlog ' TO ' sync ' @ ' 192.168.15.% ' |+------------------------------------------------------------------------------------------ ----------------------+4 rows in set (0.00 sec) mysql> Delete useless authorization information revoke select, insert, update, delete, create, drop on ' XiyoumainTXZYANDROID '. * from ' sync ' @ ' 192.168.15.% ' revoke select, insert, update, delete, create, DROP ON ' MySQL '. ' Xiyouzyadlog ' from ' sync ' @ ' 192.168.15.% ' finally don't forget flush privileges; okay, done.
This article from "Yaoshenshen" blog, declined reprint!
One-time MySQL authorization troubleshooting