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

360
Views
docker mysql en un puerto diferente

Quiero cambiar el puerto expuesto predeterminado para el contenedor acoplable mysql, pero si trato de usar este comando:

 docker run --detach --name=test-mysql -p 52000:52000 --env="MYSQL_ROOT_PASSWORD=mypassword" mysql

No funciona. mysql -uroot -pmypassword -h 127.0.0.1 -P 52000 Warning: Using a password on the command line interface can be insecure. ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

Si uso el puerto estándar 3306:3306, entonces funciona bien, pero quiero cambiar el puerto. ¿Es posible?

Ya había probado -p 52000:3600 , pero siempre obtuve:

mysql -uroot -pmypassword -h 127.0.0.1 -P 52000 Warning: Using a password on the command line interface can be insecure. ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Debe asignar el contenedor-puerto 3306 en el puerto TCP preferido (de su servidor):

 -p <host_port>:<container_port> (map container_port xx on host_port yy)

Entonces para tu mysql

 docker run --detach --name=test-mysql -p 52000:3306 --env="MYSQL_ROOT_PASSWORD=mypassword" mysql
over 4 years ago · Santiago Trujillo Report

0

también hay una segunda opción:

no asigne un puerto a otro puerto, pero deje que mysql se ejecute directamente en otro puerto usando la MYSQL_TCP_PORT .

ejemplo:

docker run --detach --name=test-mysql --env="MYSQL_TCP_PORT=52000" mysql

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!