使用@的DSN连接和密码 [英] DSN connection and password with @
问题描述
我考虑切换到使用DSN连接的数据库访问库-connect("mysql://login:password @ database?options").DSN使用@作为分隔符.这是否意味着密码不能包含@符号?还有其他限制吗?
I think about switching to DB access library that uses DSN connection - connect("mysql://login:password@database?options"). DSN uses @ as a separator. Does it mean that the password cannot contain @ symbol? Is there other restrictions?
推荐答案
使用DSN可能会遇到任何特殊字符,特别是在语言/平台转义或特殊字符规则决定干预的情况下.
Any special characters can be tricky with DSNs, particularly if the language / platform escaping or special character rules decide to intervene.
对于梨样式DSN ,我想您正在使用,使用 URL编码应该可以安全地保护特殊字符( @ ==%40
)翻译不正确.
For Pear style DSNs, which I suppose you are using, it should be safe to use URL encoding to protect special characters (@ == %40
) from being translated incorrectly.
这篇关于使用@的DSN连接和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!