Base solution for your next web application
Open Closed

MySQL - Connect Timeout expired. All pooled connections are in use #12109


User avatar
0
[email protected] created

Hi,

I keep getting this error message: MySQL - Connect Timeout expired. All pooled connections are in use

I followed this integration tutorial: https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/doc/WebSite/EF-Core-MySql-Integration.md

Except the last step with the workaround because I couldn't find the Program.BuildWebHost() since I think it doesn't exist anymore and the application starts without a problem. Only after some seconds the application throws all these errors.

public static class PortalDbContextConfigurer { public static void Configure(DbContextOptionsBuilder<PortalDbContext> builder, string connectionString) { var serverVersion = new MySqlServerVersion(new Version(9, 0, 1)); builder.UseMySql(connectionString, serverVersion); } public static void Configure(DbContextOptionsBuilder<PortalDbContext> builder, DbConnection connection) { var serverVersion = new MySqlServerVersion(new Version(9, 0, 1)); builder.UseMySql(connection, serverVersion); } }


6 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi benjamin.edinger

    Can you share the ConnectionString with us? Please censor important information. Here you can define the Max Pool Size setting according to your needs. This will probably solve your problem.

    If the problem persists after you apply this, do not hesitate to contact us.

  • User Avatar
    0
    [email protected] created

    "ConnectionStrings": { "Default": "server=127.0.0.1;uid=root;pwd=password;database=mydb" },

    If I set the Max Pool Size won't the App then crash either? There must be an answer why the App creates so much pools

    Thats what I use: ASP.NET CORE & Angular .NET 8.0 v13.3.0

  • User Avatar
    0
    [email protected] created

    Hi benjamin.edinger

    Can you share the ConnectionString with us? Please censor important information. Here you can define the Max Pool Size setting according to your needs. This will probably solve your problem.

    If the problem persists after you apply this, do not hesitate to contact us.

    Set the Max Pool Size to 10 now I get hte error earlier

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Thank you for your return. We will examine this situation.

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi,

    It should be fixed at Aspnetzero 13.3.0 Could you update your project?

    https://github.com/aspnetboilerplate/aspnetboilerplate/issues/6950

  • User Avatar
    0
    [email protected] created

    Hi,

    Updated the project and works fine now. Thanks!