MySQL恢复数据库错误ERROR 1166 (42000) at line 10779: Incorrect column name ''

此错误是由于:
view的select子句中,被union all的第二个select子句的常量空格字段没有指定名称,
手工生成此view时无错误,但是导出此view的create语句时,mysql自动将每个字段默认了名称

CREATE ALGORITHM=UNDEFINED
DEFINER=`root`@`localhost` SQL SECURITY DEFINER
VIEW `v_temp` AS select `tb1`.`col1` AS `names` from `tb1` union all select '' AS `` from `tb2`

你可能感兴趣的:(mysql)