Bug #85458 Unable to connect to the database after update to 2.1.5
Submitted: 15 Mar 2017 9:34 Modified: 28 Mar 2017 11:38
Reporter: - - Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / Python Severity:S2 (Serious)
Version:2.1.5 OS:CentOS (7.3)
Assigned to: CPU Architecture:Any

[15 Mar 2017 9:34] - -
Description:
Version 1.1.6 of the connector works, 2.1.5 will fail.

Code block:

try:
	db_connection = db_connector.connect(user='root', password=root_pw, unix_socket=socket_path)
except db_connector.Error as e:
	print ('Can\'t connect to the database. {0}'.format(e.msg))
	sys.exit(2)

will result in:
Can't connect to the database. Access denied for user 'root'@'localhost' (using password: YES)

switch back to 1.1.6 it will work.
 
Database: mariadb-server-5.5.52-1.el7.x86_64 (That comes with CentOS)

How to repeat:
Let the script run with 2.1.5.
[17 Mar 2017 11:47] Chiranjeevi Battula
Hello  ??,

Thank you for the bug report.
I could not repeat the issue at our end using with Connector / Python 2.1.5, MySQL 5.6 and 5.7 versions.
Could you please provide repeatable test case (exact steps/sample code, screenshot etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[17 Mar 2017 12:06] - -
Hi Chiranjeevi,
yes of course.

1. make sure, that the epel repo is enabled.
2. yum install mysql-connector-python
3. try to run the script
4. it works.
5. download version 2.1.5 from the mysql site
6. run update yum update /tmp/mysql-connector-python-2.1.5-1.el7.x86_64.rpm
7. run the script again.
8. Now it fails. 
9. yum downgrade mysql-connector-python
10. run the script again.
11. the script will run.

Database: mariadb-server-5.5.52-1.el7.x86_64 (Comes with CentOS/RHEL)
[17 Mar 2017 12:07] - -
The test case file

Attachment: test.py (text/x-python), 579 bytes.

[28 Mar 2017 11:38] Chiranjeevi Battula
Hello  ??,

Thank you for your feedback.
I could not repeat the issue at our end using with Connector / Python 2.1.5, MySQL 5.6 and 5.7 version and Mariadb.
Please use "root_pw = f.readline().strip()" to get the password.

Thanks,
Chiranjeevi.