title: mysql-docker-container - ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
body: <p>i am creating mysql docker container using below docker-compose file. Service is created successfully but when i am trying to enter inside the container getting the below error
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</p>
  <pre><code>docker container exec -it 966 /bin/bash
  root@96607883960b:/# mysql -uroot -p
  Enter password: 
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  root@96607883960b:/# 
  
  
  
  version: '3.3'
  
  services:
     db:
      image: mysql:5.7.29
      container_name: mysql
      deploy:
        replicas: 1
        restart_policy:
          condition: on-failure
      environment:
        - MYSQL_USER=&quot;testpass&quot;
        - MYSQL_PASSWORD=&quot;testpass&quot;
        - MYSQL_ROOT_PASSWORD=&quot;testpass&quot;
      ports:
        - 33060:3306
      volumes:
        - /Users/hello/Work/Volumes/wavolumes/mysql:/var/lib/mysql
  </code></pre>
  <p>i found many articles didn't help to resolve this issue</p>
  <p>is any one having the solution for this issue ?</p>