开发者

Dump mysql view as a table with data - version 2

开发者 https://www.devze.com 2022-12-31 20:44 出处:网络
Q: Is there a way to direct MYSQLDUMP to export VIEW\'s with data (and not just the CREATE SQL开发者_如何学Python)?I want to use the resulting SQL to create a new table.

Q: Is there a way to direct MYSQLDUMP to export VIEW's with data (and not just the CREATE SQL开发者_如何学Python)? I want to use the resulting SQL to create a new table.

Thanks! Jon


I don't know method how to dump only view without table. But you could try next method:

  1. Run next command from shell:

    mysql -u[username] -p[password] -e "SHOW CREATE VIEW [view_name]" > [view_name]_dump.sql

  2. Then modify generated sql script manually.
0

精彩评论

暂无评论...
验证码 换一张
取 消