Trying the docker mysql image but user/password does not work

firegate666

I have a simple docker setup using php7 and mysql, both from docker hub. Setting up is ok so far, everything starts up and I can access my app. But I can't get the mysql connect to work for me. I even logged in into the box and tried accessing the db, but it fails. Anybody any idea?

docker-compose.yml

db:
  restart: always
  image: mysql/mysql-server:5.7
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: root
    MYSQL_USER: myapp
    MYSQL_PASSWORD: myapp
    MYSQL_DATABASE: myapp
web:
  restart: always
  image: silintl/php7
  command: php -S 0.0.0.0:8000 -t /app/web
  links:
    - db
  ports:
    - "8000:8000"
  volumes:
    - ../:/app

trying to access the db

[bash]marcobehnke@Marcos-MacBook-Pro-2 ~ $ docker exec -it docker_db_1 bash

[root@7eff3007bb11 /]# mysql --user=myapp --password=myapp --host=localhost --port=3306 myapp
mysql: [Warning] Using a password on the command line interface can be insecure.

ERROR 1045 (28000): Access denied for user 'myapp'@'localhost' (using password: YES)
[root@7eff3007bb11 /]#

What am I missing here?

Edit: Have a look at my github repo, this is the exact config I am using: https://github.com/firegate666/docker-php7-mysql-postgres

firegate666

Ok, I took a different machine and tried my setup, it worked out of the box. I have no idea whyt this is about, but the problem is obviously my machine :-)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Javascript image warning does not work

From Dev

mysql not like does not work

From Dev

Creating Event in MySQL does not work

From Dev

How does the onbuild directory work for the official Rails docker image?

From Dev

Docker log in command does not work

From Dev

PDF inline Image does not work

From Dev

docker push to registry does not work

From Dev

Rollback does not work in MySQL

From Dev

Docker: wget for https does not work

From Dev

trying to start an image in docker

From Dev

Trying to understand how does the AWS scaling work

From Dev

connecting to a docker-compose mysql container denies access but docker running same image does not

From Dev

Trying to run Cloudera Image in Docker

From Dev

@CreatedDate annotation does not work with mysql

From Dev

show image on hover does not work

From Dev

mysql not like does not work

From Dev

Docker: How does this (not) work?

From Dev

trying to access Thunderbird-tabmail does not work

From Dev

Rollback does not work in MySQL

From Dev

MySQL DELETE does not work

From Dev

Does tagging a Docker image create a copy of the image?

From Dev

Trying to draw an image icon in graphics but it wont work

From Dev

I am trying to put this glitched image in my website, I put the CSS code and HTML in but it still does not work

From Dev

Docker mysql official image

From Dev

Sometimes image reduction does not work

From Dev

.bash_profile does not work with docker php image

From Dev

GD Library image generation does not work with mySQL query

From Dev

Trying to trigger a `click` event on js, does not work

From Dev

Docker image does not work on AWS Fargate but it does in EC2

Related Related

HotTag

Archive