Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!