php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78870 Connection errors appear in error.log
Submitted: 2019-11-26 13:13 UTC Modified: 2019-11-26 15:02 UTC
From: hhsnakeg at gmail dot com Assigned:
Status: Open Package: MySQLi related
PHP Version: 7.2.24 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-11-26 13:13 UTC] hhsnakeg at gmail dot com
Description:
------------
When I use persist connection on PHP use call mysqli_real_connect with parameter host 'p:localhost' causes error connection when I call the connection second time.
After that, a new database connection is created with a new id.

When we connect to the database for the first time we see a message in the general log:
454 Connect   dbuser@localhost on dbscheme using Socket
When we reuse connection (connect second time) we see a message in the general log:
454 Connect   Access denied for user 'dbuser'@'localhost' (using password: NO)
455 Connect   dbuser@localhost on dbscheme using Socket
and in the error log we see the same message:
454 [Note] Access denied for user 'dbuser'@'localhost' (using password: NO)

I think this error appeared after changes in version 7.2.24 (Fixed bug #76809 (SSL settings aren't respected when persistent connections are used).


Test script:
---------------
<?php

function connect()
{
    $connectionID = mysqli_init();
    $ok = mysqli_real_connect($connectionID,
        'p:localhost',
        'dbuser',
        'dbpass',
        'dbscheme',
        3306,
        "",
        0);
    mysqli_select_db($connectionID, 'dbsheme');
}

connect();
connect();


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-11-26 13:47 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-11-26 13:47 UTC] cmb@php.net
Just to clarify:
 - are you using PHP 7.2.25 or 7.2.24?
 - which driver do you use – mysqlnd or libmysqlclient?
 [2019-11-26 14:56 UTC] hhsnakeg at gmail dot com
1. use 7.2.24 

2. use mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $ 
($connectionID->get_client_info();)
Package: php7.2-mysql 
Version: 7.2.24-1+ubuntu18.04.1+deb.sury.org+1
Provides: php-mysqli, php-mysqlnd, php-pdo-mysql, php7.2-mysqli, php7.2-mysqlnd, php7.2-pdo-mysql
 [2019-11-26 15:02 UTC] cmb@php.net
-Status: Feedback +Status: Open -PHP Version: 7.2.25 +PHP Version: 7.2.24 -Assigned To: cmb +Assigned To:
 [2019-11-26 15:02 UTC] cmb@php.net
Thanks!
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 17:01:24 2019 UTC