Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

510
Vistas
mySQL error Access Denied from Server run by Docker Container

I am very new to programming and have been tasked to run an app through a docker container using mySql server. I have been unable to connect to the server (although the server is showing running in docker desktop). The error message I keep receiving via the terminal after going through the procedure is:

code: 'ER_ACCESS_DENIED_ERROR',
  errno: 1045,
  sqlState: '28000',
  sqlMessage: "Access denied for user ''@'localhost' (using password: YES)"

I am using MacOS Big Sur, with Docker Desktop Version 4.7.1, mySql Server version: 8.0.28 Homebrew, npm and nodejs.

Procedure being run in the terminal after cloning remote repo files into my local environment:

docker pull mysql/mysql-server
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<123456> -e MYSQL_DATABASE=flash_card mysql:5.7
name=$(docker inspect --format="{{.Id}}" mysql)
docker exec -i $name mysql --user=root --password=<123456> "flash_card" < dbschema.sql
npm install
node index.js # **Error occurs here**

The Docker Desktop shows the mySql server is running. When attempting to open the connection through the browser, the following error occurs:

This page isn’t working. localhost sent an invalid response.
ERR_INVALID_HTTP_RESPONSE

I tried mysql -u root -p and changing my password and flushing privileges. Restarting the SQL server. Still no luck. I do not have SQL workbench installed and would like a solution that can be done through the docker container mySQL image via the command terminal. If there is a solution through SQL workbench that would be appreciated as well.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda