Path for Mysql

On my RoR server (which I don't have root access to) there are two instances of mysql (4.0.x and 5.0.x). My database has been created in the 5.0.x instance - I can log in manually OK (so I've got the correct username and passowrd) but my RoR keeps getting denied access.

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/vendor/mysql.rb:523:in `read': Access denied for user: 'tobyr@localhost' (Using password:
YES) (Mysql::Error)

I think it may be a path issue - what do I need to do to point
Ruby at the right instance of mysql? I assume it is config/database.yaml but I'm not sure what to add or change.

It's going to either be the port on which you connect to the mysql
server or the path to the socket file.

Fred