|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61734 XP mysql_connect() gives Bad handshake error message
Submitted: 2012-04-15 01:25 UTC Modified: 2017-04-19 10:11 UTC
Avg. Score:4.6 ± 0.7
Reproduced:8 of 9 (88.9%)
Same Version:5 (62.5%)
Same OS:2 (25.0%)
From: php at lanar dot com dot au Assigned:
Status: Wont fix Package: MySQL related
PHP Version: 5.4.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
19 - 10 = ?
Subscribe to this entry?

 [2012-04-15 01:25 UTC] php at lanar dot com dot au
From manual page:
Host MySQL 5.5.21. Client php 5.4.0

   php -r "mysql_connect( 'host','user','pass', TRUE );"
works but
   php -r "mysql_connect( 'host','user','pass', TRUE, MYSQL_CLIENT_SSL );"
gives error message
   Warning: mysql_connect(): Bad handshake in Command line code on line 1

Test script:
php -r "mysql_connect( $host, $user, $pass, TRUE, MYSQL_CLIENT_SSL );"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-19 10:11 UTC]
-Status: Open +Status: Wont fix
 [2017-04-19 10:11 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

mysql_connect is a deprecated function and was removed in PHP 7.0.0.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 12:03:35 2021 UTC