开发者

Catalyst create schema can't connect but I can

开发者 https://www.devze.com 2023-01-07 07:58 出处:网络
So I can connect with (obviously I replaced all the real values) mysql -u username -p -h db.dbhostname.com dbname

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 t开发者_JAVA技巧ried 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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号