# Hangfire with Mysql don´t work

**URL:** <https://discuss.hangfire.io/t/hangfire-with-mysql-don-t-work/5121>\
**Category:** bug?\
**Tags:** mysql\
**Created:** [August 29, 2018, 5:14am UTC](https://discuss.hangfire.io/t/hangfire-with-mysql-don-t-work/5121 "2018-08-29T05:14:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucaserd](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lucaserd](https://discuss.hangfire.io/u/lucaserd)\
**Post date:** [August 29, 2018, 5:14am UTC](https://discuss.hangfire.io/t/hangfire-with-mysql-don-t-work/5121/1 "2018-08-29T05:14:44Z")

</div>

I’m using hangfire with mysql in my WebApi C # application. I do not know if I can have a conflict with EntityFramework … Have you had this problem? I need help!  
Thank you

* * *

MySqlException (0x80004005): Authentication to host [mysql.test.com](http://mysql.test.com); for user root; using method;mysql\_native\_password; failed with message: Reading from the stream has failed

[MySqlException (0x80004005): Reading from the stream has failed.]  
MySql.Data.MySqlClient.MySqlStream.LoadPacket() +270  
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +32  
MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket() +39

```
    public void Configuration(IAppBuilder app)
    {
        HttpConfiguration config = new HttpConfiguration();

        ConfigureOAuth(app);

        App_Start.WebApiConfig.Register(config);
        app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
        app.UseWebApi(config);

        Hangfire.GlobalConfiguration.Configuration.UseStorage(new Hangfire.MySql.MySqlStorage(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString));
        app.UseHangfireDashboard("/PainelEmails", new DashboardOptions
        {
            AppPath = "http://website.com/index.html"//,
            //Authorization = new[] { new HangfireAuthorization() }
        });

        EnvioEmailController obj = new EnvioEmailController();
        RecurringJob.AddOrUpdate(() => obj.SendEmailRelato(), Cron.Hourly);
        RecurringJob.AddOrUpdate(() => obj.SendEmailRelatoTentativa(), Cron.Hourly);
        RecurringJob.AddOrUpdate(() => obj.SendEmail30Dias(), Cron.Hourly);
        RecurringJob.AddOrUpdate(() => obj.SendEmail60Dias(), Cron.Hourly);
        RecurringJob.AddOrUpdate(() => obj.SendEmail90Dias(), Cron.Hourly);

        app.UseHangfireServer(new BackgroundJobServerOptions()
        {
            WorkerCount = 2
        });
    }
```

---

<div class="post-metadata">

**Author:** ![ArgeKumandan](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/argekumandan/32/1281_2.png) [@ArgeKumandan](https://discuss.hangfire.io/u/ArgeKumandan)\
**Post date:** [September 4, 2018, 9:41pm UTC](https://discuss.hangfire.io/t/hangfire-with-mysql-don-t-work/5121/2 "2018-09-04T21:41:08Z")

</div>

Hey man this error has nothing to do with Hangfire. Your connectionstring is problem. Try this it should work: [https://stackoverflow.com/questions/26652833/reading-from-the-stream-has-failed-mysqlexception](https://stackoverflow.com/questions/26652833/reading-from-the-stream-has-failed-mysqlexception) and try to learn investigate the problem
