Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于数据库导入视图 DEFINER 错误 #410

Open
oukan opened this issue Mar 23, 2021 · 1 comment
Open

关于数据库导入视图 DEFINER 错误 #410

oukan opened this issue Mar 23, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@oukan
Copy link

oukan commented Mar 23, 2021

1. 您使用的是哪个版本的 gin-vue-admin ?

2.4.0

在本地测试,并使用远程测试数据库dev_crm,一切正常

但是在服务器上又新建了一个数据库test_crm,并服务器面板中的数据库备份功能,发现登陆正常,但是无法获取菜单,表现使用为 #391 所描述的问题,错误位置 service/sys_menu.go:22 ,经过分析是,这条语句出现错误

SELECT * FROM authority_menuWHERE (authority_id = "9528") ANDauthority_menu.deleted_atIS NULL ORDER BY sort
错误提示为

#1143 - SELECT command denied to user 'dev_crm'@'%' for column 'sys_base_menu_id' in table 'sys_authority_menus'
这里出现了旧数据库的名称,错误是在里。

于是将dev_crm数据库导出,并导入到新的数据中test_crm时出出现错误

CREATE ALGORITHM=UNDEFINED DEFINER=dev_crm@%SQL SECURITY DEFINER VIEWauthority_menu AS selectsys_base_menus.idASid,sys_base_menus.created_atAScreated_at,sys_base_menus.updated_atASupdated_at,sys_base_menus.deleted_atASdeleted_at,sys_base_menus.menu_levelASmenu_level,sys_base_menus.parent_idASparent_id,sys_base_menus.pathASpath,sys_base_menus.nameASname,sys_base_menus.hiddenAShidden,sys_base_menus.componentAScomponent,sys_base_menus.titleAStitle,sys_base_menus.iconASicon,sys_base_menus.sortASsort,sys_authority_menus.sys_authority_authority_idASauthority_id,sys_authority_menus.sys_base_menu_idASmenu_id,sys_base_menus.keep_aliveASkeep_alive,sys_base_menus.default_menuASdefault_menu from (sys_authority_menusjoinsys_base_menus on((sys_authority_menus.sys_base_menu_id=sys_base_menus.id)))

临时的解决方案是将
DEFINER=dev_crm@% 直接删除,或者修改为新的数据库信息
DEFINER=test_crm@%

请问能否在数据库导出的时候自动删除 DEFINER 信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants
@oukan and others