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

**URL:** <https://www.ruby-forum.com/t/access-denied-unable-to-load-schema-into-production-db/156210>\
**Category:** Rails\
**Created:** [December 22, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/access-denied-unable-to-load-schema-into-production-db/156210 "2008-12-22T20:15:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eureka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/74df32/32.png) [@eureka](https://www.ruby-forum.com/u/eureka)\
**Post date:** [December 22, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/access-denied-unable-to-load-schema-into-production-db/156210/1 "2008-12-22T20:15:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![eureka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/74df32/32.png) [@eureka](https://www.ruby-forum.com/u/eureka)\
**Post date:** [December 22, 2008, 8:46pm UTC](https://www.ruby-forum.com/t/access-denied-unable-to-load-schema-into-production-db/156210/2 "2008-12-22T20:46:24Z")

</div>

On Mon, Dec 22, 2008 at 11:15 AM, Eu Reka  
[removed\_email\_address@domain.invalid](mailto: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](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 🙂

## FWIW,

Hassan S. ------------------------ removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![eureka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/74df32/32.png) [@eureka](https://www.ruby-forum.com/u/eureka)\
**Post date:** [December 23, 2008, 1:34am UTC](https://www.ruby-forum.com/t/access-denied-unable-to-load-schema-into-production-db/156210/3 "2008-12-23T01:34:36Z")

</div>

Hassan S. wrote:

> On Mon, Dec 22, 2008 at 11:15 AM, Eu Reka  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> If that says ON, you have an issue 🙂

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)

---

<div class="post-metadata">

**Author:** ![eureka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/74df32/32.png) [@eureka](https://www.ruby-forum.com/u/eureka)\
**Post date:** [December 23, 2008, 1:57am UTC](https://www.ruby-forum.com/t/access-denied-unable-to-load-schema-into-production-db/156210/4 "2008-12-23T01:57:09Z")

</div>

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.
