php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76660 Cannot connect to mysql 8 using Php 7.2.8
Submitted: 2018-07-24 11:30 UTC Modified: 2019-12-27 15:36 UTC
Votes:34
Avg. Score:4.9 ± 0.4
Reproduced:30 of 31 (96.8%)
Same Version:25 (83.3%)
Same OS:17 (56.7%)
From: Frank dot Peters at mobil dot hessen dot de Assigned:
Status: Duplicate Package: PDO MySQL
PHP Version: 7.2.8 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Frank dot Peters at mobil dot hessen dot de
New email:
PHP Version: OS:

 

 [2018-07-24 11:30 UTC] Frank dot Peters at mobil dot hessen dot de
Description:
------------
After upgrading to 7.2.8 from 7.2.7, no connection to mySql 8.0.11 can be made.
Using doctrine, the Error-msg is:

Type: PDOException
Message: PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109
File: C:\my_project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php
Line: 46

Downgrading to 7.2.7 solves this issue.

This might be realated to Bug #76651, so in answer to the question there:
SELECT @@default_authentication_plugin
has the result
caching_sha2_password


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-24 12:59 UTC] cmb@php.net
Related to bug #76651.
 [2018-08-06 21:09 UTC] eugene at zhegan dot in
Same story here.
 [2018-08-20 13:13 UTC] danielpopiniuc at gmail dot com
If I attempt to connect to MySQL 8.0.12 under Windows 10 build 1703 with either PHP 7.2.8 or 7.2.9 I get back a fatal error.
But if I use another MySQL client like MySQL Workbench 8.0.12 and execute a successful query, repeating same connection attempt in same conditions it works smoothly every single time (of course, until MySQL server shuts down or restarts).
From this behavior I am guessing some sort of MySQL connection initialization is not implemented properly under Windows starting with PHP 7.2.8 (still is case in 7.2.9). Hope this helps.
 [2019-12-27 15:36 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2019-12-27 15:36 UTC] nikic@php.net
caching_sha2_password support has been reverted from 7.2/7.3 shortly after, which "fixed" this issue there. The same issue for 7.4 is tracked at bug #78981.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 12:01:29 2024 UTC