Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to ProxySQL? #934

Closed
nbon12 opened this issue Jan 25, 2021 · 6 comments
Closed

Connecting to ProxySQL? #934

nbon12 opened this issue Jan 25, 2021 · 6 comments

Comments

@nbon12
Copy link

nbon12 commented Jan 25, 2021

Hi, I seem to be having an issue when connecting to ProxySQL,
I'm using MySqlConnector version 1.2.1:
Here's my breakpoint:
openconn
Then when I "Step Over"
I get this error:
stackexception
"Index was outside the bounds of the array."

@bgrainger
Copy link
Member

What's mysql-server_version set to in your ProxySQL configuration?

@nbon12
Copy link
Author

nbon12 commented Jan 25, 2021

It was set to 8.0. After updating the version in ProxySQL to 8.0.19-10, it now works! The MySQL instances were already 8.0.19-10. So it turns out that our MySQL instance version did not match the ProxySQL configuration's mysql_server_version.

FYI, I briefly tried to do this same thing with the Mysql.Data Nuget Package, I got a similar error message over there too, but their error message was more clear.

MySql.Data.MySqlClient.MySqlException (0x80004005): Version string not in acceptable format
   at MySql.Data.Common.DBVersion.Parse(String versionString)
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at Api.Rest.IoC.ApiDefaultRegsitry.GetDapperConnection[T](String connectionString, Boolean profileConnection) in C:\Users\user1\source\Api.Rest\IoC\ApiDefaultRegistry.cs:line 170
   at Api.Rest.IoC.ApiDefaultRegsitry.Load(ContainerBuilder builder) in C:\Users\user1\source\Api.Rest\IoC\ApiDefaultRegistry.cs:line 83
   at Autofac.Module.Configure(IComponentRegistryBuilder componentRegistry)
   at Autofac.ContainerBuilder.Build(IComponentRegistryBuilder componentRegistry, Boolean excludeDefaultModules)
   at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
   at Autofac.Extensions.DependencyInjection.AutofacServiceProviderFactory.CreateServiceProvider(ContainerBuilder containerBuilder)
   at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Api.Rest.Program.Main(String[] args) in C:\Users\user1\source\Api.Rest\Program.cs:line 13

@bgrainger
Copy link
Member

The ServerVersion-parsing code was unnecessarily strict; I've fixed it now: 25ce4d0.

Your change to the ProxySQL version will still be necessary until that fix ships..

@bgrainger
Copy link
Member

Fixed in 1.3.0.

@rajivsaxena
Copy link

rajivsaxena commented Sep 26, 2023

i am using mysql version 8.0.32, my Proxysql configmap file also has the same version. I am able to connect the mysql instance from proxysql in workbench but not through code, its throwing the error : "Version string is not in acceptable string format". Any suggestion would highly appreciable

@bgrainger
Copy link
Member

Version string is not in acceptable string format is an error message from MySql.Data. This is the repository for MySqlConnector.

Instructions for migrating from MySql.Data to MySqlConnector are here: https://mysqlconnector.net/tutorials/migrating-from-connector-net/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants