DSN connection and password with @

久未见 提交于 2021-02-08 03:59:25

问题


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?


回答1:


Any special characters can be tricky with DSNs, particularly if the language / platform escaping or special character rules decide to intervene.

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.



来源:https://stackoverflow.com/questions/7860365/dsn-connection-and-password-with

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!