Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我考虑切换到使用 DSN 连接的 DB 访问库 - connect("mysql://login:password@database?options")。DSN 使用@ 作为分隔符。这是否意味着密码不能包含@符号?还有其他限制吗?
任何特殊字符都可能对 DSN 很棘手,尤其是在语言/平台转义或特殊字符规则决定干预时。
对于我想您正在使用的Pear 样式 DSN ,使用URL 编码来保护特殊字符 ( @ == %40) 不被错误翻译应该是安全的。
@ == %40