New default config locations, my.cnf purpose update

This commit is contained in:
Brendan 2020-10-10 21:37:47 +01:00 committed by GitHub
parent ef7478ece5
commit 93aaad7652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,6 +76,13 @@ FLUSH PRIVILEGES;
### Allowing external database access
Chances are you'll need to allow external access to this MySQL instance in order to allow servers to connect to it. To do this, open `my.cnf`, which varies in location depending on your OS and how MySQL was installed.
Once opened, you'll want to change `bind-address=` to be `bind-address=0.0.0.0` which will allow connections on all interfaces, and thus, external connections.
More recent versions of MySQL have moved the default configuration to `mysql.conf.d/mysqld.cnf` or for MariaDB installations the default configuration should be in `50-server.cnf`. *However*, `my.cnf` has been changed to update the default configurations so you don't edit your default configuration files (this is now considered bad practice)!
If you open `my.cnf`, you'll want to add the lines:
```
[mysqld]
bind-address=0.0.0.0
```
This will override the default MySQL configuration, which by default will only accept requests from lo. Updating this will allow connections on all interfaces, and thus, external connections.
If your Node and Daemon are on the same machine, and you won't be needing external access, you can also use the `docker0` interface IP address, rather than `127.0.0.1`. This IP address can be found by running `ip addr | grep docker0`, and it likely looks something like `172.x.x.x`.