mysql 视图1449错误
2016-12-29 18:14
134 查看
这次直接导入数据表和生成视图,结果在生成视图后出现了1449的错误,原SQL语句如下:
CREATE ALGORITHM = UNDEFINED DEFINER = `skip-grants user`@`skip-grants host` SQL SECURITY DEFINER VIEW `sysusersauthorities` AS SELECT DISTINCT
`ur`.`userId` AS `userId`,
`a`.`authorityId` AS `authorityId`
FROM
(
(
`sysusersroles` `ur`
JOIN `sysrolesauthorities` `ra`
)
JOIN `sysauthorities` `a`
)
WHERE
(
(
`ur`.`roleId` = `ra`.`roleId`
)
AND (
`a`.`authorityPath` LIKE CONVERT (
concat(
'%-',
concat(`ra`.`authorityId`, ''),
'-%'
) USING gbk
)
)
)
在网上搜索过的方法尝试无效后,同事直接删除了ALGORITHM = UNDEFINED DEFINER = `skip-grants user`@`skip-grants host` SQL SECURITY DEFINER 这一句,结果视图就能正常使用了。原理不是很清楚,记一下。
CREATE ALGORITHM = UNDEFINED DEFINER = `skip-grants user`@`skip-grants host` SQL SECURITY DEFINER VIEW `sysusersauthorities` AS SELECT DISTINCT
`ur`.`userId` AS `userId`,
`a`.`authorityId` AS `authorityId`
FROM
(
(
`sysusersroles` `ur`
JOIN `sysrolesauthorities` `ra`
)
JOIN `sysauthorities` `a`
)
WHERE
(
(
`ur`.`roleId` = `ra`.`roleId`
)
AND (
`a`.`authorityPath` LIKE CONVERT (
concat(
'%-',
concat(`ra`.`authorityId`, ''),
'-%'
) USING gbk
)
)
)
在网上搜索过的方法尝试无效后,同事直接删除了ALGORITHM = UNDEFINED DEFINER = `skip-grants user`@`skip-grants host` SQL SECURITY DEFINER 这一句,结果视图就能正常使用了。原理不是很清楚,记一下。
相关文章推荐
- Mysql查询视图:ERROR 1449
- MySQL 错误号码 1449
- MySql:视图错误 There is no 'root'@'%' registered
- mysql 错误1449
- MySQL 视图 第1349号错误解决方法
- ERROR 1449 (HY000)--Mysql查询视图报错
- mysql错误代码: 1449 The user specified as a definer ('root'@'%') does not exist
- mysql错误-UncategorizedSQLException 1449
- MySQL 视图 第1349号错误解决方法
- mysql 1449错误
- MYSQL 错误:Client does not support authentication protocol requested by server;
- 常见的mysql错误:mysql error:2002 cann,t connect ...
- MYSQL语句中易忽略的语法错误
- 使用ADO+MySQL时经常出现的错误分析及总结
- MySQL中文参考手册3(MySQL邮件列表及如何提问或报告错误)
- 用Nhibernate连接多个数据库,两个Mysql,一个Sql。还有关于异常和错误码的讨论。包含源代码
- Linux+Mono+Apache2下Asp.net连接MySql的一个错误及解决方法
- 解决MySQL启动时万恶的的“1067”错误
- mysql 表修复操作 (1016错误)
- 修改所有用户表/存储过程/视图/触发器/自定义函数的所有者为dbo,则用游标(不要理会错误提示)