Dreamhost shared hosting - mysql2 - db creation issue

hi there,
i decided to build a small rails application on dreamhost (and not my
VM ubuntu machine this time).

I have set up database.yml correctly by copying the user credentials
and host name from the db administration panel.

The problem I have here is that when I run “rake db:create
RAILS_ENV=test” for the test environment, I constantly get an error
message indicating that the current user has no rights :frowning:
This problem however does not occur for the development environment.

[amalthea]$ rake db:create RAILS_ENV=test
(in /home/neon83/projects/notepad)
rake aborted!
Mysql2::Error: Access denied for user ‘padawan’@’%’ to database
‘notepad_test’: CREATE DATABASE rails3-test DEFAULT CHARACTER SET
utf8 COLLATE utf8_unicode_ci

Any ideas?

PS:
I have heard of some rumours that on dreamhost shared hosting,
scripts cannot create databases. It can only be done on the
admininstration panel for databases.

On Tue, Jul 26, 2011 at 3:14 AM, ct9a [email protected] wrote:

This problem however does not occur for the development environment.
Any ideas?

ct9a, are you credentials correct for the test database? Next, I
believe
that Dreamhost
may have a same origin policy in place. You might want to check the
particulars with
them if you’re trying to create a test database on Dreamhost from your
local
development
environment.

Good luck,

-Conrad

PS:
I have heard of some rumours that on dreamhost shared hosting,
scripts cannot create databases. It can only be done on the
admininstration panel for databases.

Hi, everyone (especially Conrad),

I had a look again closeby between my db administration page and my
database.yml.
Found that I had used dashes instead of underscores for the database
name (ie. ‘notepad-test’ when it was really supposed to be
‘notepad_test’).

Corrected that, tested and committed database.yml to git.
All works :slight_smile:

Cheers!
Gordon