Score:0

docker mysql 5.7 on ubuntu 22.04

mr flag

I'm used to using Ubuntu 20.04 and docker mysql created like this:

sudo docker run --name mysql-57-container -p 127.0.0.1:3310:3306 -e MYSQL_ROOT_PASSWORD=. -d --volume=/usr/share/docker/mysql57/conf.d:/etc/mysql/conf.d --volume=/usr/share/docker/mysql57/data:/var/lib/mysql mysql:5.7

after that I can access it using mysql -u root -p --host=127.0.0.1 --port=3310 even though I had mysql 8.0 installed on the same machine

I try to used same setting so I did the same docker command on a Ubuntu 22.04 machine, but when I try to access it I got this error ERROR 1130 (HY000): Host '172.17.0.1' is not allowed to connect to this MySQL server I hope anyone can help me why is this? thanks before

dummyuser avatar
uy flag
See https://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server
Score:0
mr flag

it looks like the docker version is a bit different. I got Docker version 20.10.22, build 3a2c30b on my 20.04 machine and Docker version 20.10.23, build 7155243 on the 22.04 machine.

on the 22.04 it cannot straightly put the path on to the volume, it need to create the volume first

sudo docker volume create --driver local --opt type=none --opt device=/usr/share/docker/mysql57 --opt o=bind mysql57_conf

and then use it in the volume part

sudo docker run --name mysql-57-container -p 127.0.0.1:3310:3306 -e MYSQL_ROOT_PASSWORD=. -v mysql57_conf:/etc/mysql -d mysql:5.7

thus the problem is gone

Score:0
ao flag

maybe you can use this command to connect ro mysql:

docker run --name mysql-57-container -p 3310:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% -d --volume=/usr/share/docker/mysql57/conf.d:/etc/mysql/conf.d --volume=/usr/share/docker/mysql57/data:/var/lib/mysql mysql:5.7

reinforcers avatar
mr flag
like I said for some reason using full path in `volume` section doesn't work on my docker. I had to do `docker volume create` first with the path
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.