Bug #88630 Cannot connect to multiple instance using odbc
Submitted: 23 Nov 2017 18:46 Modified: 24 Nov 2017 13:54
Reporter: ahmed taha Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.13 OS:Any
Assigned to: CPU Architecture:Any

[23 Nov 2017 18:46] ahmed taha
Description:
I am using windows 10 with multiple MySQL instance
every instance has its own directory,port and windows service
everything works fine for me when using Connector/Net 6.10.4
but when i am trying to use odbc it connects only to one of them

How to repeat:
   Dim mysqlcs1 As String = ""
        Dim mysqlcs2 As String = ""
        Dim mysqldb1 As IDbConnection
        Dim mysqldb2 As IDbConnection

        'using Connector/Net 6.10.4 
        mysqlcs1 = "server=localhost;database=database1;user=root;port=3306;password=123;"
        mysqlcs2 = "server=localhost;database=database2;user=root;port=3305;password=123;"
        mysqldb1 = New MySql.Data.MySqlClient.MySqlConnection(mysqlcs1)
        mysqldb2 = New MySql.Data.MySqlClient.MySqlConnection(mysqlcs2)
        mysqldb1.Open() 
        mysqldb2.Open()
        mysqldb1.Close()
        mysqldb2.Close()

'It works fine

        'using Connector/ODBC 5.1.13
        mysqlcs1 = "Driver={MySQL ODBC 5.1 Driver};server=localhost;database=database1;user=root;port=3306;password=123;"
        mysqlcs2 = "Driver={MySQL ODBC 5.1 Driver};server=localhost;database=database2;user=root;port=3305;password=123;"
        mysqldb1 = New Odbc.OdbcConnection(mysqlcs1)
        mysqldb2 = New Odbc.OdbcConnection(mysqlcs2)
        mysqldb1.Open()
        mysqldb2.Open()
        mysqldb1.Close()
        mysqldb2.Close()

This exception will thrown
        'ERROR [HY000] [MySQL][ODBC 5.1 Driver]Unknown database 'database2'

Suggested fix:
while using odbc I changed the second connection string to
 mysqlcs2="server=192.168.1.10;database=database2;user=root;port=3305;password=123;"

-"192.168.1.10" is my pc local ip address
[24 Nov 2017 9:53] Chiranjeevi Battula
Hello ahmed taha,

Thank you for the bug report.
I could not repeat the issue at our end using with Visual Studio 2015, MySQL 5.7.20 and Connector/ODBC 5.3.9 version.

Thanks,
Chiranjeevi.
[24 Nov 2017 9:54] Chiranjeevi Battula
Screenshot

Attachment: Bug_88630.png (image/png, text), 148.25 KiB.

[24 Nov 2017 13:54] ahmed taha
thank you Chiranjeevi for your response
I did it too with MySQL ODBC 5.3 UNICODE Driver and it works for me
but it still a bug in MySQL ODBC 5.1 Driver