Created
July 23, 2013 21:48
-
-
Save danilo04/6066476 to your computer and use it in GitHub Desktop.
Change the view creator mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT("ALTER DEFINER=`youruser`@`host` VIEW ", | |
table_name," AS ", view_definition,";") FROM | |
information_schema.views WHERE table_schema='databasename' | |
Mix this with the mysql command line (assuming *nix, not familiar with windows): | |
> echo above_query | mysql -uuser -p > alterView.sql | |
> mysql -uuser -ppass databasename < alterView.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment