Can MySQL reliably restore backups that contain views or not?

后端 未结 4 986
情书的邮戳
情书的邮戳 2021-02-04 14:15

Environment: Ubuntu 11.10, MySQL 5.1.58

I have a small database with views. When I try to dump and restore, I get

ERROR 1356 (HY000) at line 1693: View          


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-04 14:58

    I found the problem in my case. I'm unsure that it solves similar reports on the web.

    This was fundamentally a permission problem that resulted from trying to copy this database to a new name. Permissions didn't exist for this user and schema (locus on curation2). I manually added 'GRANT ALL ON curation2.* TO locus' (locus is the user reported in the error). After doing this, the above command line worked fine.

    The lesson is that one must manually grant necessary permissions to the destination database and tables when creating a new database.

提交回复
热议问题