i want change the default exposed port for mysql image docker, but if i try to use this command
docker run --detach --name=test-mysql -p 52000:52000 --env="MYSQL_ROOT_PASSWORD=mypassword" mysql
not work, 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
if i use the standard port 3306:3306 work fine, but i want change the port, it's possibile?
I had already tried -p 52000:3600 , but i have always:
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
You need to map the container-port 3306 on the prefered TCP port (of your server):
So for your mysql