我是靠谱客的博主 柔弱舞蹈,最近开发中收集的这篇文章主要介绍解决mysqldump备份报错: Couldn't execute 'SHOW FIELDS FROM Unknown error 1356,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
服务器环境:
[root@localhost mysql]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@localhost mysql]# uname -a
Linux localhost.localdomain 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost mysql]# CentOS Linux release 7.3.1611 (Core)
MySQL版本号:
mysql> select version();
+------------+
| version() |
+------------+
| 5.7.13-log |
+------------+
1 row in set (0.00 sec)
报错具体情况:
[root@localhost tmp]# mysqldump -uroot -p --default-character-set=utf8 --triggers -R --hex-blob --flush-logs --events --single-transaction --master-data=2 --all-databases|gzip >/tmp/134-20170831.sql.gz
Enter password:
mysqldump: Couldn't execute 'SHOW FIELDS FROM `v_product_info`': Unknown error 1356 (1356)
之前,由于数据库作主要用于测试,数据量不大,所以直接用的是mysqldump备份,没有出过问题。今天根据报错提示,是`v_product_info`这个视图出了问题;
下面排查问题所在:
mysql> select * from information_schema.tables where TABLE_NAME LIKE '%v_product_info%' AND table_type='view'G;
mysql> USE POSEIDON;
mysql> SHOW CREATE VIEW v_product_infoG;
下面为视图内容:
CREATE ALGORITHM = UNDEFINED DEFINER = `dev_oheimdall_user`@`%` SQL SECURITY DEFINER VIEW `v_product_info` AS SELECT
`a`.`id` AS `id`,
`a`.`product_name` AS `product_name`,
`a`.`feechannel_name` AS `feechannel_name`,
`d`.`branch` AS `branch`,
`a`.`product_city` AS `product_city`,
`a`.`product_type` AS `product_type`,
`a`.`mortgage_lend_terms` AS `mortgage_lend_terms`,
`c`.`sparehouse_require` AS `sparehouse_require`,
`a`.`lend_time_start` AS `lend_time_start`,
`a`.`lend_time_end` AS `lend_time_end`,
`a`.`month_rate_start` AS `month_rate_start`,
`a`.`month_rate_end` AS `month_rate_end`,
`a`.`repayment_mode` AS `repayment_mode`,
`a`.`gmt_create` AS `gmt_create`,
`a`.`status_name` AS `status_name`,
`a`.`creater` AS `creater`,
(
CASE
WHEN (
`a`.`id` = `b`.`product_basic_id`
) THEN
`b`.`credit`
WHEN (
`a`.`id` = `c`.`product_basic_id`
) THEN
`c`.`credit_require`
END
) AS `credit`
FROM
(
(
(
`product_basic` `a`
LEFT JOIN `product_credit_admit` `b` ON (
(
`a`.`id` = `b`.`product_basic_id`
)
)
)
LEFT JOIN `product_mortgage_admit` `c` ON (
(
`a`.`id` = `c`.`product_basic_id`
)
)
)
LEFT JOIN `fund_channel` `d` ON (
(
`a`.`feechannel_id` = `d`.`id`
)
)
)
解决问题办法:
mysql> DESC product_basic;
ERROR 1146 (42S02): Unknown error 1146
mysql> DESC product_mortgage_admit;
ERROR 1146 (42S02): Unknown error 1146
mysql> DROP VIEW v_product_info;
Query OK, 0 rows affected (0.10 sec)
然后再进行备份,发现很快顺利完成。
转载于:https://blog.51cto.com/9285090/1961500
最后
以上就是柔弱舞蹈为你收集整理的解决mysqldump备份报错: Couldn't execute 'SHOW FIELDS FROM Unknown error 1356的全部内容,希望文章能够帮你解决解决mysqldump备份报错: Couldn't execute 'SHOW FIELDS FROM Unknown error 1356所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复