Connecting to a MySQL server docker instance from localhost

  docker, mysql

I created a MySQL server docker instance using the following command:

[[email protected] ~]$ docker run --name mysql_db -p 6604:3306 -e MYSQL_ROOT_HOST='%' -e MYSQL_ROOT_PASSWORD='jose' -d mysql/mysql-server:5.7

When I try to connect to the server, I get the following error:

[[email protected] ~]$ mysql -uroot -pjose -h localhost -P6604
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

How should I fix my commands to be able to connect to the server instance using my local MySQL client?

Source: Docker Questions