MYSQL backup and restore

Posted by Codezy on Server Fault See other posts from Server Fault or by Codezy
Published on 2009-12-18T20:02:12Z Indexed on 2010/03/28 17:03 UTC
Read the original article Hit count: 520

Filed under:
|
|

I am having trouble getting mysql backups to run properly when their are views in the database. I think this might have something to do with needing a placeholder object for it. In any event I run this command:

mysqldump -u myuser -pmypassword mydatabase | mysql -u myuser -pmypassword -C mydatabase_Beta

The user has full privileges and I get this:

View mydatabase_beta.yadayada references invalid tables or columns or functions or definer/invoker or view lack rights to use them.

How can I back it up so that it restores all of my database properly? In the example I am restoring it to a different name but I do need to be able to restore a working copy. I think it is probably an additional mysqldump parameter or maybe hot copy would work better. Thoughts?

© Server Fault or respective owner

Related posts about mysql

Related posts about mysqldump