One-time MySQL authorization troubleshooting

Source: Internet
Author: User

Describe the situation, there is a database Xiyouzyadlog with sync authorization &nbsp, 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.