Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phpmyadmin export VIEW without DATABASE_NAME or ALGORITHM

When exporting a sql dump with phpmyadmin it creates the VIEW table like this:

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER 
VIEW `database`.`table` etc..

Each time I have to manually edit the sql dump to remove the root user and database name.

like image 960
John Magnolia Avatar asked Mar 31 '12 14:03

John Magnolia


1 Answers

It's only taken 8 years but phpmyadmin now includes an option to prevent this issue:-

Exclude definition of current user

This appears under the CREATE VIEW section, select this and you will get a properly working extract.

like image 128
deep64blue Avatar answered Sep 27 '22 23:09

deep64blue