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

221
Visualizações
mysql cli to 127.0.0.1 but redirect to 172.17.0.1

I have installed mysql-client in my Mac by the following command:

brew install mysql-client

And when I run the following command:

mysql -h 127.0.0.1 -u root -p 

An ERROR 1045 occured:

ERROR 1045 (28000): Access denied for user 'root'@'172.17.0.1' (using password: NO)

but when I use Sequel Pro I can login the local mysql server.

Why the 127.0.0.1 becomes 172.17.0.1 ?


MORE DETAIL INFO

I run this command on local host iTerm. I use the docker pull to pull a mysql:5.7 image from docker registry:

docker run --name mysql -e MYSQL_ROOT_PASSWORD=xxxxxx -d -p 0.0.0.0:3306:3306 mysql:5.7

And the mysql container is just running, then I use Sequel Pro GUI client to connect into the database in docker, and it works. And then I try to use

brew install mysql-client

to install the mysql command (because I want to use it to run a sql file to prepare data for my project's tests suite). after installed mysql-client, i use the command

mysql -h 127.0.0.1 -u root -p

try to connect database, but it promote the

**ERROR 1045 (28000): Access denied for user 'root'@'172.17.0.1' (using password: NO)**.

I did not do any configuration for the mysql docker container.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

After hours try and search, finally I found the solution:

mysql -h 127.0.0.1 -P 3306 -u root -p

you need a -P parameter

over 4 years ago · Santiago Trujillo Relatório
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