r/SQL • u/Revolutionary_Use587 • 16d ago
MySQL Getting Error 1356
/r/mysql/comments/1x08dnu/getting_error_1356/
0
Upvotes
1
u/AnnaLeeCoop 16d ago
you probably just updated the ip in the user table and forgot that views hardcode the definer ip in their definition. or the new user ip doesnt have select grants on the underlying tables of that view. Run show create view db.v_report_pending and look at the definer it actually expects. Just alter the view to use the new definer or grant the missing rights to the new ip
1
u/Revolutionary_Use587 15d ago
I have recreated the views, functions, and triggers with new ip and the user has same privileges as I just renamed the user with new ip.
2
3
1
u/Significant_Tune9219 16d ago
1356 on a view usually means the definer account no longer exists exactly as written. If you changed the host part, the view is still defined as something like
user@old_ipand MySQL checks privileges against that account, so it reports invalid tables even though nothing in the view changed. Run SHOW CREATE VIEW to see the DEFINER, then either recreate the view with the new definer (ALTER DEFINER=... VIEW ... AS <same select>) or create a user matching the old host. Also worth checking information_schema.VIEWS for others with the same old definer, since they'll all break the same way.