Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL: Host X is not allowed to connect to this MySQL server #3454

Open
aldesrahim opened this issue Oct 7, 2023 · 2 comments
Open

MySQL: Host X is not allowed to connect to this MySQL server #3454

aldesrahim opened this issue Oct 7, 2023 · 2 comments

Comments

@aldesrahim
Copy link

aldesrahim commented Oct 7, 2023

Description:

Fresh install laradock using latest mysql
git clone https://github.com/laradock/laradock.git
mysql version:
image

i've spent 5+ hours, trying to figure out why adminer or phpmyadmin cant connect to mysql, i tried everything i found online, buat none of them works, so after several tries, i found that the problem was:

  1. after re-creating container, or first run the container, it will throw error about cant connect using root@localhost, but i dont know what trigger this
  2. then i tried to comment these lines. and everything worked fine (my.cnf inside mysql folder)
    image

Expected Behavior:

Normally connect to mysql

Context information:

Output of git rev-parse HEAD

660afa968deb3dbb883ce9b29fe7d40a403dde61

Output of docker version

Client: Docker Engine - Community
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:31:44 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:31:44 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.24
  GitCommit:        61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
 runc:
  Version:          1.1.9
  GitCommit:        v1.1.9-0-gccaecfc
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker compose version

Docker Compose version v2.21.0

System info: Mac, Windows or Linux. Include which disto/version

Linux (Pop!_OS 22.04 LTS)

Steps to reproduce the issue:

  1. clone latest laradock
  2. run docker compose up mysql
  3. it will print container_name exited 1 (or something like that)

Stacktrace & Additional info:

message `container_name exited 1` (or something like that), only shows on the first run, to re-produce, you need to delete folder `DATA_PATH_HOST=~/.laradock/data`, run `docker system prune`, rebuild mysql image, run `docker compose down -v`, then run `docker compose up mysql`
@tvaughan73
Copy link

I am having the same issue on Windows WSL2 - Ubuntu.

@evenZh
Copy link

evenZh commented Oct 17, 2023

I am having the same issue on Windows WSL2 - Ubuntu.

I edited file laradock/mysql/my.cnf:

#[client]
#user=root
#password=root
Then do rebuild mysql:

#sudo rm -rf ~/.laradock/data/mysql; ## Warning!
cd laradock/
docker-compose build mysql --no-cache
docker-compose up mysql --force-recreate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants