Trying to update the production mysql database by doing: rvmsudo RAILS_ENV=production rake db:schema:load on ubuntu 10.04 with rails 3.1.0. The purpose of update is to add a table. The mysql db already exists. Here is the error with trace:
dtt@ubuntu:/var/www/mylab/current$ rvmsudo RAILS_ENV=production rake db:schema:load --trace
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:schema:load
-- create_table("categories", {:force=>true})
rake aborted!
Mysql2::Error: DROP command denied to user 'dtt'@'localhost' for table 'categories': DROP TABLE `categories`
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `query'
However running rake command without RAILS_ENV=production is fine without error. But it only created the development db.
Any thoughts about the error? Thanks.
The user you have configured for your
productionenvironment inconfig/database.ymldoes not have permission to perform the necessary actions on the production environment. Either you need to change your MySQL setup or use a different user.