|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19481 DB doesn't allow for '@' within password (p@ssword)
Submitted: 2002-09-18 15:04 UTC Modified: 2002-10-28 23:08 UTC
From: rob at euglug dot org Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rob at euglug dot org
New email:
PHP Version: OS:


 [2002-09-18 15:04 UTC] rob at euglug dot org
If you have an '@' in your password, DB.php parses that as the token that separates the user:pass@host of the DSN.  It should preferrably allow passwords with '@'.

I can send a patch, but what is the preferred way of handling something like this?  Asking the user to put the pass in quotes?  Or somehow determining what is the separator token and what is the password?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-02 04:37 UTC]
Please provide us your patch and we'll see.
 [2002-10-02 19:02 UTC] alan at akbkhome dot com
you can rawurlencode the @ sign %40
username = xxx
password = yy@yy

dns = mysql://xxx:yy%40yy@localhost/mydb

If the dsn is to follow 'http url standards' (eg. the rfc), then there is no need to change the code.. (just need to document it somewhere)
 [2002-10-28 23:08 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

If your password contains non-alphanumeric characters do a urlencode() on the value before passing it if you are using the "mysql://foo:bar+@localhost/foo" format to pass data to DB::connect();
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 12:01:31 2024 UTC