Skip to content

Instantly share code, notes, and snippets.

@danilo04
Created July 23, 2013 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danilo04/6066476 to your computer and use it in GitHub Desktop.
Save danilo04/6066476 to your computer and use it in GitHub Desktop.
Change the view creator mysql
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