MySQL Forums
Forum List  »  Views

Mysqldump use view definition without databasename?
Posted by: J Bouvrie
Date: January 10, 2020 06:11AM

Is there a way to have mysqldump output a view definition without hard references to the (current) database name?

For example: suppose I have view "myview" in database "mydatabase":
CREATE VIEW `myview` as SELECT col1,col2 FROM `mytable`;

When mysqldump runs, the dump will instead have this definition:
CREATE VIEW `myview` as SELECT col1,col2 FROM `mydatabase`.`mytable`;

Is there a way to exclude the `mydatabase` reference from the view definition, so the resulting dump can be imported properly in another database name?

Options: ReplyQuote


Subject
Views
Written By
Posted
Mysqldump use view definition without databasename?
254
January 10, 2020 06:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.