You are not logged in.

#1 2019-01-19 18:59:39

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 229
Website

How to allow remote access for mysql?

Hi there everyone!

I've been reading search result one after another that explains to /etc/mysql/my.cnf to comment the bind-address but it doesn't have anything in it but pulling other files in, so I just started going through all the linked files but I just can't find it anywhere.

Where is this setting and how do I change it?

Thanks for your time!


Schw.im! A social site with an identity crisis.

Offline

#2 2019-01-19 19:11:51

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 229
Website

Re: How to allow remote access for mysql?

Hey, I found it in "/etc/mysql/mariadb.conf.d/50-server.cnf" and commented bind-address but on mysql restart I went from a complete failure to an error message:

"Host xxx.xxx.xxx.xxx is not allowed to connect to this MariaDB server"

I'm not sure what else would be blocking the connection.  Any insight would be greatly appreciated!


Schw.im! A social site with an identity crisis.

Offline

#3 2019-01-19 19:14:27

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,527

Re: How to allow remote access for mysql?

Check your grants. MySQL identifies users by a tuple (user, host), written in the form user@host. If there is no grant for read privileges to a user user@theremotehost, or written with a wildcard for any host user@%, then the connection will be denied. Naturally, you would grant the remote user all the privileges it needs, plus, you need to be bound to an IP address reachable from the remote host.

Edit: See https://dev.mysql.com/doc/refman/8.0/en/grant.html.


New Horizons

Offline

#4 2019-01-19 19:22:59

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 229
Website

Re: How to allow remote access for mysql?

plus, you need to be bound to an IP address reachable from the remote host.

So there is no "any host" option available with this privilege system?


Schw.im! A social site with an identity crisis.

Offline

#5 2019-01-19 19:34:44

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,527

Re: How to allow remote access for mysql?

schwim wrote:

plus, you need to be bound to an IP address reachable from the remote host.

So there is no "any host" option available with this privilege system?

There is. As I said, use the % wildcard for the hostname when creating grants. The matter of the mysql server being bound to a publicly reachable IP address is a different matter entirely. In the most simple case, you would bind to 0.0.0.0 to listen on all interfaces. IDK if the default of mysql is binding to 127.0.0.1 or 0.0.0.0 though.


New Horizons

Offline

#6 2019-01-19 19:36:22

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 229
Website

Re: How to allow remote access for mysql?

Scratch that, got the hang of %!

Thanks for your help!


Schw.im! A social site with an identity crisis.

Offline

Board footer

Powered by FluxBB