views:

34

answers:

2

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.

A: 

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

hobbs
Still no go. The connect string I have in mine, and the new one you provided both work from a little 10 line test script that just uses DBI, preparing and executing a simple select. Also, I've ruled out typos by copying what I had on the command line into that test script. Thanks for the quick follow up.
Felix
+1  A: 

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.

Felix
Amusingly enough I almost put the username and password in single quotes in my example "for safety", but I said "well, at-signs don't need quoting in the shell..." and didn't. Oh well, glad to hear it's a simple oversight and not a nefarious bug.
hobbs
please remember to accept your answer.
xenoterracide
Apparently there's some waiting period before I can accept my own answer....23 hours remain.
Felix