Catalyst 创建架构无法连接,但我可以

发布于 2024-09-10 03:20:12 字数 727 浏览 9 评论 0原文

所以我可以连接(显然我替换了所有实际值)

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

庆幸我还是我 2024-09-17 03:20:12

我不认为 mysql DSN 是这样工作的。尝试将脚本运行为:(

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

更改的部分只是 DSN,但我使用反斜杠换行符对其进行了格式化,以便您可以根据需要粘贴它)。

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

筑梦 2024-09-17 03:20:12

抱歉浪费了您的时间。我觉得自己像个白痴。我的密码中有一个美元符号,而且我没有费心将其放在引号中,因此它本质上是在尝试扩展环境变量时截断密码。正确引用它解决了问题。再次感谢您的回复霍布斯,顺便说一句,原始连接字符串也可以工作。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文