[英]Take a backup of rake db migration. and command denied for rake db:migrate rake aborted
I have db version 11. I want to move back to version 10 and add another version. 我的数据库版本为11。我想移回版本10,并添加另一个版本。 But before that I want to take backup of version 11. How can I do that?
但是在此之前,我想备份版本11。我该怎么做? I am using ruby 1.8.7 and rails 1.2.6.
我正在使用ruby 1.8.7和rails 1.2.6。
rake db:migrate version=10
output: rake aborted! ActiveREcord::StatementInvalid: Mysql::Error SELECT command denied to user ''@'%' for column slot in table 'users'
输出:
rake aborted! ActiveREcord::StatementInvalid: Mysql::Error SELECT command denied to user ''@'%' for column slot in table 'users'
rake aborted! ActiveREcord::StatementInvalid: Mysql::Error SELECT command denied to user ''@'%' for column slot in table 'users'
Any help ? 有什么帮助吗?
That's a mighty old version of Rails you're using there! 那是您在那里使用的强大的Rails旧版本!
You want to run a down migration to go back to a previous version: 您想要运行向下迁移以返回到以前的版本:
rake db:migrate:down version=10
To make a backup first, use the client utility for your database. 要首先进行备份,请对数据库使用客户端实用程序。 For example, with MySQL:
例如,对于MySQL:
mysqldump -u username -p databasename > dumpfile.sql
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.