0

I have created a Docker container using the following command:

docker run --network host --name mariadb -e MYSQL_ROOT_PASSWORD=testpass -d mariadb:latest

I'm trying to connect to the MariaDB Docker container in my IntelliJ project and getting the following error:

The specified database user/password combination is rejected:
[28000][1045] Access denied for user 'root'@'127.0.0.1' (using password: YES)

When I run without --network host and use container's IP 172.18.0.2, I get the following error:

[08][-1] Could not connect to address=(host=172.18.0.2)(port=3306)(type=master) : connect timed out
java.net.SocketTimeoutException: connect timed out.

I even tried updating bind-address in my.cnf file in the container but no success.

Please help me.

Abdullah Khawer
  • 3,566
  • 4
  • 21
  • 52
  • Check this thread https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost – Andrey Sep 22 '19 at 16:57
  • better to verify the connection first inside container `docker exec -it mariadb bash -c " mysql -u root -ptestpass"` – Adiii Sep 22 '19 at 19:04

1 Answers1

0

Maybe this can help you out sir?

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000021659-The-specified-database-user-password-combination-is-rejected

  • That is not the issue. Tried that. :) – Abdullah Khawer Sep 22 '19 at 15:59
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Jeroen Heier Sep 22 '19 at 16:02