dialog.so cannot be loaded with perl and python clients when plugin-dir is set on [client] section of my.cnf

Bug #1155859 reported by Jaime Sicam
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Sergei Glushchenko
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
Medium
Sergei Glushchenko
5.6
Fix Released
Medium
Sergei Glushchenko

Bug Description

Assuming this is set on my.cnf:

[client]
plugin-dir=/usr/lib64/mysql/plugin

On Perl Client, with source code:
use DBI;
 $dbh = DBI->connect('dbi:mysql:mysql;mysql_read_default_file=/etc/my.cnf','ap','123')
 or die "Connection Error: $DBI::errstr\n";
 $sql = "select * from mysql.user";
 $sth = $dbh->prepare($sql);
 $sth->execute
 or die "SQL Error: $DBI::errstr\n";
 while (@row = $sth->fetchrow_array) {
 print "@row\n";
 }

This will error out as:
DBI connect('mysql;mysql_read_default_file=/etc/my.cnf','ap',...) failed: Authentication plugin 'dialog' cannot be loaded: /dialog.so: cannot open shared object file: No such file or directory at mysqltest.pl line 2
Connection Error: Authentication plugin 'dialog' cannot be loaded: /dialog.so: cannot open shared object file: No such file or directory

However, if you copy dialog.so to parent directory(/), it will work.

On Python client, with source code:
import MySQLdb
db = MySQLdb.connect(host="localhost", user="ap", passwd="123", db="mysql",read_default_file="/etc/my.cnf")

This will error out as:
  File "test.py", line 3, in <module>
    db = MySQLdb.connect(host="localhost", user="ap", passwd="123", db="mysql",read_default_file="/etc/my.cnf")
  File "/usr/lib64/python2.6/site-packages/MySQL_python-1.2.4b4-py2.6-linux-x86_64.egg/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/MySQL_python-1.2.4b4-py2.6-linux-x86_64.egg/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, "Authentication plugin 'dialog' cannot be loaded: \xf5\xae\xc43\xef\x7f/dialog.so: cannot open shared object file: No such file or directory")

If installation is based on RPM, say for CentOS 6, you can comment out plugin-dir in my.cnf file and authentication will work.

However, the issue is dialog.so won't be loaded if Percona Server is installed using the binary version and placing it on a custom directory.

Related branches

Jaime Sicam (jssicam)
summary: - dialog.so cannot be loaded when plugin-dir is set in my.cnf [client]
- section and using mysql_read_default_file and read_default_file options
- to load default config respectively
+ dialog.so cannot be loaded with perl and python clients when plugin-dir
+ is set on [client] section of my.cnf
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

This is not a bug of pam plugin, but likely a bug of client library.

no longer affects: percona-pam-for-mysql
Changed in percona-server:
status: New → Confirmed
Jaime Sicam (jssicam)
tags: added: i29131
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

After plugin-dir is fixed, there still an issue with dialog.so loading. Looks like dialog.so and MySQLdb should be linked with same client library, either libmysqlclient or libmysqlclient_r to be able to be loaded.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Issue seems to be only my setup. On freshly installed system everything work nice. Tested with python and MySQLdb.

tags: added: upstream
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Upstream fix in 5.5.32.

Revision history for this message
k srinivasan (mailtosrinivas) wrote :

Hi I am using LDAP, There is no password is stored in mysql , I am getting the below error — Error No:2059 , Authentication plugin ‘mysql_clear_password’ cannot be loaded: plugin not enabled , how to solve the problem ? ,
 Through .net connector i need connect the mysql server, How to solve the problem.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-82

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.