Phpmyadmin 导出 VIEW 没有 DATABASE_NAME 或 ALGORITHM

2022-01-05 00:00:00 php mysql phpmyadmin

当使用 phpmyadmin 导出 sql 转储时,它会像这样创建 VIEW 表:

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..

每次我必须手动编辑 sql 转储以删除 root 用户和 database 名称.

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

推荐答案

虽然只用了 8 年,但 phpmyadmin 现在包含一个选项来防止这个问题:-

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

排除当前用户的定义

这出现在 CREATE VIEW 部分下,选择它,您将获得一个正常工作的摘录.

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

相关文章