PDA

View Full Version : Forbiden character in MySQL password?


malta
02-20-2008, 05:06 PM
Hi.

After using Easy PHP Calendar with a flat db file for a while I decided to switch to a MySQL database. The problem is that I was given a password to the database by our sysadmin that contains the characters $ and @ ( $xxxx@x ) , and when I enter it in EzPHPCal's setup manager I get the access denied error [Access denied for user 'webadm'@'localhost' (using password: YES)]. I should also mention that once the page is reloaded only the @ and the following character reappear in the setup manager's mysql password field; hence I concluded that the full password is not being passed to the database. I've already tried to enter the password manually in config.inc.php and to escape the aforementioned characters with backslashes...

Considering that this password is already used in other corporate applications I really don't want to request the sysadmin to change it, so I was wondering if there is a workaround for this issue.

Thanks.

Brian
02-20-2008, 08:25 PM
Try manually editing the config.inc.php file and add your password there.

ve9gra
02-20-2008, 08:57 PM
I've already tried to enter the password manually in config.inc.php and to escape the aforementioned characters with backslashes...

I really don't know how to deal with this one...

Brian
02-20-2008, 08:59 PM
I didn't catch that the first time through. :ugh:

ve9gra
02-21-2008, 09:04 AM
At first I thought it was because of the @, but after I re-read the post, I now believe that the problem is with the first character being $...

Is it possible that the script somehow thinks that $xxxx@x is a variable? Or rather $xxxx be a variable that is to be appended to @x? Since $xxxx doesn't exist, only "@x" show up in the Setup Manager.

This is going back to PHP string handling... So if I'm correct, you should be able to enter \$xxxx@x in the Setup Manager and make it work. Do not escape the @ as it is not a special character in a PHP string.

malta
02-21-2008, 10:50 AM
Thanks a lot for the quick replies. I got a connection to the database.

I had already tried to escape the $, but I still couldn't connect to the database even though the password was properly saved in the config file. The solution was to escape an extra backslash to be processed when EzPHPCal tries to connect to the database, that is, after the config file is saved. So I entered "\\\$xxxx@x" instead of only "$xxxx@x" in the password field.

It looks kinda funny, but it's enough to get it going...