Catalyst 创建架构无法连接,但我可以
所以我可以连接(显然我替换了所有实际值)
mysql -u username -p -h db.dbhostname.com dbname
但是当我运行 Catalyt 的创建脚本时,我得到
$ ./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
它的行为就像数据库服务器不允许来自 whereiam.com 的连接,但我可以通过命令行连接就好了,并尝试暂时从任何地方打开数据库连接,但仍然没有成功。很抱歉我能提供的信息很少,但这就是我目前所拥有的全部信息。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为 mysql DSN 是这样工作的。尝试将脚本运行为:(
更改的部分只是 DSN,但我使用反斜杠换行符对其进行了格式化,以便您可以根据需要粘贴它)。
I don't think mysql DSNs work that way. Try running the script as:
(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.