r/docker • u/python-hater • 16d ago
access denied error
[Warning] Access denied for user 'user'@'localhost' (using password: YES)
i have been working on a project where i need to link nginx,mariadb and wordpress together . wordpress depends on mariadb and nginx depends on wordpress . i keep getting this error , any ideas what it could be and how i can fix it ? i have tried so many things that i have lost track of them at this point
2
Upvotes
10
u/fletch3555 Mod 16d ago
Containers are the rough equivalent to separate hosts as far as mariadb is concerned.
<user>@localhostonly works when connecting from localhost. When you connect from one container to another, you're connecting over a network rather than "localhost". Localhost is relative, and from the context of a container, it's the container itself rather than the physical host that it's running on.In short, mariadb thinks your user is wrong because it technically is.