Skip to content
Advertisement

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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement