Report this

What is the reason for this report?

Can't connect to MySQL db

Posted on February 16, 2020

Hello,

I’ve got a droplet that run ubuntu and I’ve installed mysql to it. I can reach it from my computer with SSH connection from mysql workbench, so the remote access is ok. The hostname is : 127.0.0.1

The bind address in my mysqld.cnf: 127.0.0.1

I’ve got a .net core api and I would like to use docker to run it. I made the container push to docker hub and pulled it to the droplet. When i try to run I get this error: An error occurred using the connection to database ‘’ on server ‘127.0.0.1’.

My connection string: “Server=127.0.0.1;Port=3306;Database=db;Uid=user;Pwd=pass”

i tried to server:

  • localhost
  • the ip of my server

I don’t understand why can I connect to db from mysql workbench and cannot from .net core web api.

The .net core version is 3.1

Thank you for the answer

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.