Bug #67612 [NEW]: Unable to handle passwords with certain characters

From: Date: Sun, 13 Jul 2014 23:08:55 +0000
Subject: Bug #67612 [NEW]: Unable to handle passwords with certain characters
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186604@lists.php.net to get a copy of this message
From:             twood at edao dot biz
Operating system: Ubuntu 14
PHP version:      str_size_and_int64 branch
Package:          PDO MySQL
Bug Type:         Bug
Bug description:Unable to handle passwords with certain characters

Description:
------------
Attempting to connect to a mysql database with a password containing
")!" (e.g. 1234)!56) fails as if it is the wrong password.

Connecting to MySql directly (at the command line) with the same
username and password works.

When the password is changed --just by removing the two characters--
connections at both the command line and from php work.


PHP version 5.5.9-1ubuntu4.3
mysql  Ver 14.14 Distrib 5.5.37, for debian-linux-gnu (x86_64) using
readline 6.3
Both running on the same machine

Test script:
---------------
define('DB_HOST', 'localhost');
define('DB_NAME', 'nootcards');
define('DB_USERNAME', 'nootsite');
define('DB_PASSWORD', '3kDo3)!9a4X');
# Alphanumerics characters have been changed from the actual password
# but the password contains exactly the same number of passwords
# as the one that results in a failed connection



try {
	$dbh = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME, DB_USERNAME,
DB_PASSWORD);
} catch (PDOException $e) {
	return returnResult( 1000, "Database error: " . $e->getMessage() );
}


-- 
Edit bug report at https://bugs.php.net/bug.php?id=67612&edit=1
-- 



Thread (3 messages)

« previous php.bugs (#186604) next »