php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60844 mysqlnd does not work with non-native pluggable authentication
Submitted: 2012-01-23 01:00 UTC Modified: 2012-01-25 17:43 UTC
From: FM_Silver at gmx dot de Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.3.9 OS: Debian 6.0.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: FM_Silver at gmx dot de
New email:
PHP Version: OS:

 

 [2012-01-23 01:00 UTC] FM_Silver at gmx dot de
Description:
------------
Using mysql 5.5.19, loaded auth_socket plugin and created a user to auth with it:

mysql> INSTALL PLUGIN auth_socket SONAME 'auth_socket.so';
mysql> CREATE USER 'someuser'@'localhost' IDENTIFIED WITH auth_socket;

Also assume an existing database 'website'.

Trying to auth with user someuser works, when using the mysql client, but fails with mysqlnd as shown below.

Test script:
---------------
<?php
$mysqli = new mysqli("localhost", "someuser", "", "website");

if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
            exit();
}

printf("Host information: %s\n", $mysqli->host_info);

$mysqli->close();
?>

Expected result:
----------------
Host information: Localhost via UNIX socket

Actual result:
--------------
PHP Warning:  mysqli::mysqli(): (08004/1251): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /home/someuser/mysql.php on line 2
PHP Stack trace:
PHP   1. {main}() /home/someuser/mysql.php:0
PHP   2. mysqli->mysqli() /home/someuser/mysql.php:2
Connect failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-25 17:43 UTC] johannes@php.net
Pluggable authentication support was added to PHP 5.4. The auth_socket plugin works there:

mysql> CREATE USER 'johannes'@'localhost' IDENTIFIED WITH auth_socket;
mysql> exit
$ whoami
johannes
$ php54 -r '$mysqli = new mysqli("localhost", "johannes", "", "test", 0, "/tmp/mysql55.sock"); echo $mysqli->query("show grants")->fetch_row()[0];'
GRANT USAGE ON *.* TO 'johannes'@'localhost'
 [2012-01-25 17:43 UTC] johannes@php.net
-Status: Open +Status: Bogus
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 15:01:35 2025 UTC