I am currently stuck on how to proceed. This app is hosted on site5.
mysql version 4.1 I believe. I posted this on their forums, and also on
mysql forums. Is anyone able to confirm whether it’s a rails issue or
not, or mysql, or something with the web hosting server.
I can’t load my schema into my rails production DB. I’m hoping this is a
simple problem.
I Created mysql database called batman_production.
I Created a user Joker with ALL privileges granted to
batman_production.
I can log into mysql with -u Joker and the correct password. I can see
‘batman_production’ when I type ‘show databases;’.
I then exit mysql and go into my rails app folder and run:
‘rake db:schema:load RAILS_ENV=production’. I then get 'Access denied
for user ‘Joker’@‘localhost’ to database ‘batman_production’.
I double-checked the database.yml file and it has Joker’s credentials.
Any suggestions on where to proceed from here? Thank you!
Now on your production system, log into mysql and enter
mysql> show variables like ‘%pass%’;
±--------------±------+
| Variable_name | Value |
±--------------±------+
| old_passwords | OFF |
±--------------±------+
1 row in set (0.07 sec)
Thanks for your reply.
I ran the command you suggested and it’s set to off:
mysql> show variables like ‘%pass%’;
±--------------±------+
| Variable_name | Value |
±--------------±------+
| old_passwords | OFF |
±--------------±------+
1 row in set (0.00 sec)
I managed to solve the problem. It seems my database.yml was missing
two characters in the database name in both production and development.
The host I am using automatically adds a prefix to both database name
and user name. Once I corrected the names in my database.yml, recreated
the user, and re-granted permissions, I was able to complete the
migration.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.