MySQL Forums
Forum List  »  Newbie

Re: How do I fix error 1045
Posted by: Zach Ellis
Date: November 03, 2023 09:26AM

these are the tables in the mysql database that deal with the grants. These would be other tables you might change based on your situation.

from the manual 6.2.3
Grant Table Overview
These mysql database tables contain grant information:
• user: User accounts, static global privileges, and other nonprivilege columns.
• global_grants: Dynamic global privileges.
• db: Database-level privileges.
• tables_priv: Table-level privileges.
• columns_priv: Column-level privileges.
• procs_priv: Stored procedure and function privileges.
• proxies_priv: Proxy-user privileges.
• default_roles: Default user roles.
• role_edges: Edges for role subgraphs.
• password_history: Password change history.

a note from the manual if your getting an error after a manual update of the user table.

Direct modification of grant tables using statements such as INSERT, UPDATE,
or DELETE is discouraged and done at your own risk. The server is free to
ignore rows that become malformed as a result of such modifications.
For any operation that modifies a grant table, the server checks whether the
table has the expected structure and produces an error if not. To update the
tables to the expected structure, perform the MySQL upgrade procedure. See
Section 2.10, “Upgrading MySQL”.

I think one of the articles had the flush privileges command in it. But when you manually edit the tables of the grants tables it wont take effect until you use the flush privileges. Should have added that to my first response.
to further read into it go to 6.2.13 When Privilege Changes Take Effect of the manual.

Zach Ellis

Options: ReplyQuote

Written By
November 01, 2023 07:39AM
November 01, 2023 03:06PM
December 05, 2023 11:14PM
November 03, 2023 07:32AM
Re: How do I fix error 1045
November 03, 2023 09:26AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.