Bug #47185 Solaris does not support static and dynamic library link simulteniously .
Submitted: 8 Sep 2009 5:50 Modified: 9 Sep 2009 5:50
Reporter: Amit Bora Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:soalris 10 OS:Solaris
Assigned to: CPU Architecture:Any

[8 Sep 2009 5:50] Amit Bora
Description:
Hi,

I have build one application which uses static reference of MySQL 4.0 old version library and dynamic reference of new version as MySQL 5.1 version library.
On Solaris
When I try to connect to MySQL server 5.1 using MySQL 5.1 library in application it always uses the old version library instead 5.1 library and I get the following error:

DataAccess: MySQL error: Client does not support authentication protocol requested by server; consider upgrading MySQL client; errno = 1251

On solaris 10 mahcine I have only installed MySQL 5.1. When I try to connect to MySQL server using mysql prompt it connects properly.

Also I have written one sample application which only uses the MySQL 5.1 library dynamic reference and trying to connect to Server 5.1. it connects successfully.

I wonder why in my Application it uses the old even I given or linked the new 5.1 version library.

How to repeat:
Use sample application.
Take static linking of MySQL 4.0.13 version library.
Take dynamic or static link of 5.1.34 version library.
Try to run the application.

Try to connect server 5.1.34 using mysql_real_connect() using 5.1.34 library.

It will gives you error.
[8 Sep 2009 6:44] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

If you already linked your application with 4.0 it is expected what application would not use dynamic linking.
[8 Sep 2009 7:00] Amit Bora
Basically, In the same application I have two functionality 
1 for 4.0.13 server connection
2 for 5.1.34 server connection.

I want to connect 5.1.34 MySQL server for this. In code I used 5.1.34 library given link to it. But internally run time it uses 4.0.13 library and giving me error.
Even I set the LD_LIBRARY_PATH, PATH to the installed MySQL server 5.1.34 library and there no any MySQL 4.0.13 installed on machine.
[9 Sep 2009 5:50] Amit Bora
Thanks for your help.
I have Solved my problem using linking option -Bdirect at compile time.