Strange password behavior with mysql container
Hi there, I'm fairly new to Podman so apologies if my question seems simple, but seem to be experiencing some odd behavior with Mysql and no amount of googling has yielded answers. I'm using Podman 1.70 on Fedora 31. If i create a container using the following command: podman run -dt --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> mysql it creates a running container without a problem. If i perform an inspection I can also see that the MYSQL_ROOT_PASSWORD environment variable is set correctly. Logging into the container is another story. If I try to do: podman exec -it mysql mysql -u root -p I get a login prompt, but entering my password results in ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Error: non zero exit code: 1: OCI runtime error However, if I do: podman exec -it mysql bash and get into a bash prompt inside the container, and then do: mysql -u root -p ( i.e. effectively the exact same command ) I am able to login with the exact same password. It seems when I try to use podman exec to go straight to the mysql commandline, it is garbling or mangling my password. Could it be something locale or charmap related? Or is it a bug? Same issue if I try to connect using PHPMyadmin, adminer, wordpress etc - it just won't let me login using my password ( which I know does work ). Any tips on how I could get this to work? Surely people have successfully managed to get mysql working with podman? Kind Regards Sebastiaan Stoffels
On 1/23/20 6:21 PM, Sebastiaan wrote:
Hi there, I'm fairly new to Podman so apologies if my question seems simple, but seem to be experiencing some odd behavior with Mysql and no amount of googling has yielded answers.
I'm using Podman 1.70 on Fedora 31.
If i create a container using the following command:
podman run -dt --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> mysql
it creates a running container without a problem. If i perform an inspection I can also see that the MYSQL_ROOT_PASSWORD environment variable is set correctly.
Logging into the container is another story.
If I try to do: podman exec -it mysql mysql -u root -p
I get a login prompt, but entering my password results in ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Error: non zero exit code: 1: OCI runtime error
However, if I do:
podman exec -it mysql bash
and get into a bash prompt inside the container, and then do: mysql -u root -p ( i.e. effectively the exact same command )
I am able to login with the exact same password.
It seems when I try to use podman exec to go straight to the mysql commandline, it is garbling or mangling my password. Could it be something locale or charmap related? Or is it a bug? Same issue if I try to connect using PHPMyadmin, adminer, wordpress etc - it just won't let me login using my password ( which I know does work ).
Any tips on how I could get this to work? Surely people have successfully managed to get mysql working with podman?
We have been having some issues with podman exec and conmon, which has been fixed in the upstream. https://github.com/containers/libpod/pull/4818 If you could try out the master branch this might already be fixed.
Kind Regards
Sebastiaan Stoffels
_______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
for mysql create user 'user'@'%' ... of for root 'root'@'%' .... when you connect to mapped port you are not on localhost ... you must enable login from another hosts to mysql (or mariadb) ... this has nothing with podman container 31. 01. 2020. u 03:16, Daniel Walsh je napisao/la:
On 1/23/20 6:21 PM, Sebastiaan wrote:
Hi there, I'm fairly new to Podman so apologies if my question seems simple, but seem to be experiencing some odd behavior with Mysql and no amount of googling has yielded answers.
I'm using Podman 1.70 on Fedora 31.
If i create a container using the following command:
podman run -dt --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> mysql
it creates a running container without a problem. If i perform an inspection I can also see that the MYSQL_ROOT_PASSWORD environment variable is set correctly.
Logging into the container is another story.
If I try to do: podman exec -it mysql mysql -u root -p
I get a login prompt, but entering my password results in ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Error: non zero exit code: 1: OCI runtime error
However, if I do:
podman exec -it mysql bash
and get into a bash prompt inside the container, and then do: mysql -u root -p ( i.e. effectively the exact same command )
I am able to login with the exact same password.
It seems when I try to use podman exec to go straight to the mysql commandline, it is garbling or mangling my password. Could it be something locale or charmap related? Or is it a bug? Same issue if I try to connect using PHPMyadmin, adminer, wordpress etc - it just won't let me login using my password ( which I know does work ).
Any tips on how I could get this to work? Surely people have successfully managed to get mysql working with podman?
We have been having some issues with podman exec and conmon, which has been fixed in the upstream.
https://github.com/containers/libpod/pull/4818
If you could try out the master branch this might already be fixed.
Kind Regards
Sebastiaan Stoffels
_______________________________________________ Podman mailing list --podman@lists.podman.io To unsubscribe send an email topodman-leave@lists.podman.io
_______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io -- Krešimir Mihalj, spec.ing.techn.inf. Sektor za informacijske sustave
Sveučilište u Zagrebu, *Sveučilišni računski centar (Srce)*, www.srce.unizg.hr <https://www.srce.unizg.hr> kresimir.mihalj@srce.hr <mailto:kresimir.mihalj@srce.hr>, tel: +385 1 616 5864, mob: +385 99 2563746
I will try that, although Interestingly, I found that removing the spaces between the -u and -p flags and issuing the command like this: podman exec -it mysql mysql -uroot -p<password> works, so somehow having -u[SPACE] <user> vs -u<user> makes a difference. I'll try it with the 'user'@'%' as well. ---- On Fri, 31 Jan 2020 18:21:09 +1100 Krešimir Mihalj <mailto:kmihalj@srce.hr> wrote ---- for mysql create user 'user'@'%' ... of for root 'root'@'%' .... when you connect to mapped port you are not on localhost ... you must enable login from another hosts to mysql (or mariadb) ... this has nothing with podman container 31. 01. 2020. u 03:16, Daniel Walsh je napisao/la: -- Krešimir Mihalj, spec.ing.techn.inf. Sektor za informacijske sustave Sveučilište u Zagrebu, Sveučilišni računski centar (Srce), https://www.srce.unizg.hr mailto:kresimir.mihalj@srce.hr, tel: +385 1 616 5864, mob: +385 99 2563746 _______________________________________________ Podman mailing list -- mailto:podman@lists.podman.io To unsubscribe send an email to mailto:podman-leave@lists.podman.io On 1/23/20 6:21 PM, Sebastiaan wrote: Hi there, I'm fairly new to Podman so apologies if my question seems simple, but seem to be experiencing some odd behavior with Mysql and no amount of googling has yielded answers. I'm using Podman 1.70 on Fedora 31. If i create a container using the following command: podman run -dt --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> mysql it creates a running container without a problem. If i perform an inspection I can also see that the MYSQL_ROOT_PASSWORD environment variable is set correctly. Logging into the container is another story. If I try to do: podman exec -it mysql mysql -u root -p I get a login prompt, but entering my password results in ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Error: non zero exit code: 1: OCI runtime error However, if I do: podman exec -it mysql bash and get into a bash prompt inside the container, and then do: mysql -u root -p ( i.e. effectively the exact same command ) I am able to login with the exact same password. It seems when I try to use podman exec to go straight to the mysql commandline, it is garbling or mangling my password. Could it be something locale or charmap related? Or is it a bug? Same issue if I try to connect using PHPMyadmin, adminer, wordpress etc - it just won't let me login using my password ( which I know does work ). Any tips on how I could get this to work? Surely people have successfully managed to get mysql working with podman? We have been having some issues with podman exec and conmon, which has been fixed in the upstream. https://github.com/containers/libpod/pull/4818 If you could try out the master branch this might already be fixed. Kind Regards Sebastiaan Stoffels _______________________________________________ Podman mailing list -- mailto:podman@lists.podman.io To unsubscribe send an email to mailto:podman-leave@lists.podman.io _______________________________________________ Podman mailing list -- mailto:podman@lists.podman.io To unsubscribe send an email to mailto:podman-leave@lists.podman.io
participants (3)
-
Daniel Walsh -
Krešimir Mihalj -
Sebastiaan