-
-
Notifications
You must be signed in to change notification settings - Fork 574
Error: couldn't create database bcms_dev: error creating MySQL database bcms_dev: Error 1045: Access denied for user 'root'@'172.17.0.1' (using password: YES) #2278
Comments
Could you please provide outputs of commands (The output of |
One quick respones: The error message I think you need to check:
first. Also, in this part: |
Based on a few other posts out there I'm wondering if the way the database
settings are used to communicate with my docker instance of Mariadb is
passing in the username of ***@***.*** which for some reason is getting
translated inside the docker instance to ***@***.*** internal to the instance
which maybe is 172.27.0.1
When I connect to the mariadb from mysql workbench with an account and my
password it connects fine to my mariadb instance. But I think the passing
of the more fully qualified ***@***.*** is converting to localhost being
resolved as the internal ip of the instance which is not authenticating.
Maybe I can just add a grant that somehow allows that ***@***.***
Sorry I thought this communication issue was something getting passed from
the code where something in the pop code was converting it to
***@***.*** (maybe it is but I think what I describe above may be what
is going on)
Any additional suggestions are appreciated.
Eric
Eric Sobczak
***@***.***
Chief Technology Officer
*Design Force Marketing*
*https://designforcemarketing.com <https://designforcemarketing.com>*
231-766-7347 office
…On Mon, Jun 20, 2022 at 6:43 AM Yonghwan SO ***@***.***> wrote:
One quick respones:
The error message Error 1045: Access denied... might be generated by the
mariadb which means the network connection to the mariadb (on the
localhost if you configured correctly) from pop was successful but the
server rejected the access on the authentication stage.
I think you need to check:
1. Your configurations including auth parts
2. If the server got the connection.
3. Server's authentication configuration.
first.
—
Reply to this email directly, view it on GitHub
<#2278 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZ6QOG42TAK7FVS23ZBGMDVQBDOLANCNFSM5ZG276IA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Oh, you are using docker! Then it make sense. So you just treat it as "the mariadb is on the localhost" but actually the dbms is not on your localhost but on the docker's network. Just SNAT hides the structure from client but the server still feels it. Then the address part, 172.17.0.1, could be the IP of your host (maybe your laptop, desktop, or server) on the docker network. Please check your network using |
It seems to be that I need to be able to leave the localhost off the config
See:
https://stackoverflow.com/questions/69903716/access-denied-for-user-root172-17-0-1-for-a-mysql-db-running-in-a-local-doc
It seems that buffalo/pop is trying to send username and host to
authenticate versus just username that for example mysqlworkbench or a few
other things allow so unless there is a way to get it to just authenticate
with a username I may have to setup an account on the docker that matches
the ip to be able to get it to authenticate right.
Thanks,
Eric
Eric Sobczak
***@***.***
Chief Technology Officer
*Design Force Marketing*
*https://designforcemarketing.com <https://designforcemarketing.com>*
231-766-7347 office
…On Mon, Jun 20, 2022 at 11:34 AM Yonghwan SO ***@***.***> wrote:
Oh, you are using docker! Then it make sense. So you just treat it as "the
mariadb is on the localhost" but actually the dbms is not on your localhost
but on the docker's network. Just SNAT hides the structure from client but
the server still feels it.
Then the address part, 172.17.0.1, could be the IP of your host (maybe
your laptop, desktop, or server) on the docker network. Please check your
network using ifconfig or whatever. You may be able to see that address
on the bridge.
—
Reply to this email directly, view it on GitHub
<#2278 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZ6QOAPLSUIIRSRVITMVNLVQCFPNANCNFSM5ZG276IA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
No, saying again, this is not a thing Actually, MariaDB doesn't know if they are running in the container as the same as your application with Again, the address [1] https://dev.mysql.com/doc/refman/8.0/en/connection-access.html From my laptop, I can see the following: $ ip addr
<...>
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:c0:30:bf:67 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:c0ff:fe30:bf67/64 scope link
valid_lft forever preferred_lft forever As you can see, the default IPv4 address for the "docker host" (== my laptop) on the docker bridge is
Yeah, you need to check your MariaDB's The following is my configuration for my test server: mysql> select user,host,db from db;
+---------------+-----------+--------------------+
| user | host | db |
+---------------+-----------+--------------------+
| hxxxxxxxxx | localhost | hc_% |
| mysql.session | localhost | performance_schema |
| mysql.sys | localhost | sys |
+---------------+-----------+--------------------+
3 rows in set (0.01 sec)
mysql> select user,host from mysql.user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| debian-sys-maint | localhost |
| hxxxxxxxxx | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+
6 rows in set (0.00 sec) As you can see, I just configured all clients from the localhost, but allowed databases with the same wildcard Please read the MySQL document above for more about MySQL's authentication. |
I reinitized the docker image with a new root password and everything seems to working right. Consistent in mysql workbench and with buffalo and pop itself. Thanks |
Even with mariadb set and database.yml configured buffalo is trying to communicate with 172.17.0.1 even though db is localhost at 127.0.0.1
buffalo pop create -a -c database.yml
Error: couldn't create database bcms_prod: error creating MySQL database bcms_prod: Error 1045: Access denied for user 'root'@'172.17.0.1' (using password: YES)
or
buffalo dev
then visiting http://localhost:3000/
couldn't start a new transaction: could not create new transaction: Error 1045: Access denied for user 'root'@'172.17.0.1' (using password: YES)
The text was updated successfully, but these errors were encountered: