Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create view gives permission errors. Need super priv #240

Open
welrachid opened this issue Oct 28, 2021 · 0 comments
Open

Create view gives permission errors. Need super priv #240

welrachid opened this issue Oct 28, 2021 · 0 comments

Comments

@welrachid
Copy link

welrachid commented Oct 28, 2021

When importing on a different system the user might not be the same as from the exporting db.
I came across this when building an auto dump - auto import script.

I found this SO solution valuable
https://stackoverflow.com/questions/17600564/create-algorithm-undefined-definer

DROP TABLE IF EXISTS `table_view`;
/*!50001 DROP VIEW IF EXISTS `table_view`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `table_view` AS select * from table */

The problem here is DEFINER=root@localhost

Which needs to be CURRENT_USER() or else i will have this error:
ERROR 1227 (42000) at line 3: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

For now i've manually set it with a workaround with my own append_extra_sqls dumpsettings ( #239 )

Hope someone can make a change in the code so that it works out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant