Cannot connect to the mysql database from ASP.NET project

I’ve made a mySQL database but whenever I try to connect it times out “server not found”. The weird part is that I can connect to the database by using the mysql workbench (using the same server/creditentials). The connectionstring I use is the following:

Thanks for your help!

I think, you should check your connection string in web.config file, that you’re trying to deploy.

Hello @alex187,

We provide some connection strings as an example here hopefully it helps!

1 Like

Helloo @Monroy.
I have trouble too, connecting to mysql database. I used the connection string in your provided link, but it’s still not working. I also can connect to MySQL Workbench without a problem.


Has anyone figured that out yet? I still have the same problem.


Sergio Nunes

I’m using it in this way

<add name="yourname" providerName="MySql.Data.MySqlClient" connectionString=";uid=youruser;password=yourpassword;database=yourdb;persistsecurityinfo=True" />

missing port number?

It should work just like that. If required, the MySQL port number is 3306 while MSSQL is 1433.