• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Resolved (bug ?) mysql_pconnect() fails if password contains $

AdrianC

Basic Pleskian
Plesk 17.5.3 on Centos.
I just noticed that if my database password contains "$" I get "access denied for user@localhost" error in PHP.
It works to connect just fine from other database tools, but in PHP I get db connection error.
I think also Plesk uses "$" when generating a random password.
You might want to fix that because for us it can be a pain to debug.
 
This is no bug in plesk, but normal php string behaviour.
$ is interpreted as the start of a variable in php. So when that is in a password, you need to escape it.

$_DB["password"] = "mypas$word"; translates for php in mypas + the content of the variable $word, as $word is not initialized or filled, it will be empty and the password you pass to mysql will be in this case: mypas .... resulting in an error.

it should be

$_DB['password'] = 'mypas$word'; (single quotes)
or
$_DB['password'] = "mypas\$word"; (escape the $)

Personally i find using single quotes less error prone.

regards
Jan
 
Well that's embarrasing, I was fully aware of all the above but I didn't realise it :)
Thanks.

// Maybe it would still be good for Plesk to avoid generating passwords containing $, as a precaution.
 
Back
Top