简体   繁体   中英

How to force view creation with MySQL?

I have a view that MySQL refuses to create, because it references a column that doesn't exist:

ERROR 1054 (42S22): Unknown column 'd.completed' in 'where clause'

Is there any way to force MySQL to create this view? (Even though it will not be possible to use it until the column is created.)

(The reason I want to do this is I had a working view, which subsequently broken after a column was deleted. I'm creating a schema migration to fix the view, but, as with all my other migrations, I would also like to be able to revert to the current situation.)

您可以使用-f选项从mysql命令行强制创建视图:

mysql -f -u UserName -p < dump.sql

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM