'Access Denied' - unable to load schema into production DB


#1

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!


#2

On Mon, Dec 22, 2008 at 11:15 AM, Eu Reka
removed_email_address@domain.invalid wrote:

I am currently stuck on how to proceed. This app is hosted on site5.
mysql version 4.1 I believe.

‘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.

My immediate WAG would be password length discrepancy:

Note this from the old mysql-default-database.yml –

And be sure to use new-style password hashing:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html

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)

mysql>

If that says ON, you have an issue :slight_smile:

FWIW,

Hassan S. ------------------------ removed_email_address@domain.invalid


#3

Hassan S. wrote:

On Mon, Dec 22, 2008 at 11:15 AM, Eu Reka
removed_email_address@domain.invalid wrote:

If that says ON, you have an issue :slight_smile:

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)


#4

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.