Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

501
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda