Bug #16453 how to skip view when use mysqldump
Submitted: 12 Jan 2006 14:50 Modified: 4 Jul 2011 17:00
Reporter: lucols lucols Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version:5.0 OS:Any (all)
Assigned to:
Triage: D5 (Feature request)

[12 Jan 2006 14:50] lucols lucols
when mysqldump to backup database, if db include some views , and these views use the function in the db ;example , my db is db1(schema like this), function is fun1, view : view1  , view1 used fun1 to get something . after mysqldum finish, the view become to : /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`admin`@`192.168.0.%` SQL SECURITY DEFINER VIEW `view1` AS select sql_no_cache `a`   from `tab1` `x` where (`x`.`STATUS` = `db1`.`fun1`(_gbk'cc'))   */;
As you see , the schema added to fun1, now when the dumped data  be import other database which not the same schema 'db1', the data cant import and error happen, I must remove the statement about view in thd dump's data,and then create them again. 
so,  mysql  intend to provider some way like this : mysqldump --sikp-schema or mysqldump --skip-view to export data?

How to repeat:
[6 Feb 2009 1:21] Roel Van de Paar
This can be done using the --ignore-table option.

See also: http://bugs.mysql.com/bug.php?id=42635
[4 Jul 2011 17:00] Valerii Kravchuk
There is a solution already, based on last comment.