Felix
Felix

Reputation: 699

Catalyst create schema can't connect but I can

So I can connect with (obviously I replaced all the real values)

mysql -u username -p -h db.dbhostname.com dbname

But when I run Catalyt's create script I get

$ ./script/dasgift_create.pl model DB \
    DBIC::Schema MyApp::Schema create=static \
    components=TimeStamp \
    dbi:mysql:dbname:db.dbhostname.com username p@55w0rd
DBIx::Class::Schema::Loader::make_schema_at():
DBI Connection failed:
DBI connect('dbname:db.dbhostname.com','username',...) failed:
Access denied for user 'username'@'whereiam.com' (using password: YES)
at /opt/local/lib/perl5/site_perl/5.8.9/DBIx/Class/Storage/DBI.pm line 1104

Its behaving like the db server isn't allowing connections from whereiam.com, but I can connect via the command line just fine, and tried opening the db up to connections from anywhere temporarily, still with no success. Sorry for what little information I could provide, but that's all I have presently.

Upvotes: 0

Views: 1176

Answers (2)

Felix
Felix

Reputation: 699

Sorry to have wasted your time. I feel like a moron. My password had a dollar sign in it and I didn't bother to put it in quotes, so it was essentially truncating the password trying to expand an environment variable. Quoting it properly fixed the problem. Thanks again for your response hobbs, btw the original connect string works as well.

Upvotes: 1

hobbs
hobbs

Reputation: 240049

I don't think mysql DSNs work that way. Try running the script as:

./script/dasgift_create.pl model DB DBIC::Schema MyApp::Schema \
create=static components=TimeStamp \
'dbi:mysql:database=dbname;host=db.dbhostname.com' \
username p@55w0rd

(the changed part being just the DSN, but I formatted it with backslash-newlines for you so you can paste it if you want).

Upvotes: 1

Related Questions