-
Notifications
You must be signed in to change notification settings - Fork 444
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
Access denied for user 'root'@'ip' (using password: YES) #232
Comments
Changing the password fixed the issue. I'm guessing the issue had something to do with special characters in the password. Perhaps this should be added to the documentation on docker hub so others can deal with this issue if they encounter it. Here is the password that was causing issues (it's no longer in use so not a security concern): |
Did you use quotes around the password string? $ docker run -d --name=mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD="Y%257z6v9-qFvVG%db%wS76=$xjxey7?" mariadb:latest
7b4333a33c1b69db75c79b0a77b334e4d0574cbcf51e12044feac37861d9331a
$ docker exec -it mariadb mysql -u root -pY%257z6v9-qFvVG%db%wS76=$xjxey7?
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.3.8-MariaDB-1:10.3.8+maria~bionic mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> |
I did. I still wasn't able to connect. I suspect it's to do with the |
In the container root@7b4333a33c1b:/# env | grep PASSWORD
MYSQL_ROOT_PASSWORD=Y%257z6v9-qFvVG%db%wS76=? |
Indeed. I'm sure there's a way to prevent this. Perhaps single quotes. But I suspect most won't know this and it would be valuable to document this on the docker hub page. Perhaps rewriting the docs so that they prevent this from happening by default. |
I had somewhat forgotten about this duplicate issue: #183 "entrypoint script does not escape password properly" Which is waiting on docker-library/mysql#471 (comment)
|
Closing as duplicate of #183. 👍 |
Oh, this is partially #183, but also just the way that shell quoting works: $ echo foo $bar baz
foo baz
$ echo "foo $bar baz"
foo baz
$ echo 'foo $bar baz'
foo $bar baz See also https://www.gnu.org/software/bash/manual/bashref.html#Single-Quotes vs https://www.gnu.org/software/bash/manual/bashref.html#Double-Quotes. |
I've previously set up a mariadb container without issue and was able to connect to the root account remotely to set up users, databases, etc.
I'm setting a new server up and, for whatever reason, I'm unable to connect to the root account, getting the message in the title.
Here is the command I used to create the container:
I've tried wiping the
/mnt/disks/data/mariadb
directory and starting over. I still get the message.Logs are showing nothing out of the ordinary.
The text was updated successfully, but these errors were encountered: