external database access / mysql

Locked
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

external database access / mysql

Post by tom83 »

Hi,

What are the steps to make external database (mysql) access?

Also, I tried to create a rule into Firewall, and there's no "Save" button? When I go back into that screen, the rule is gone.
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

Re: external database access / mysql

Post by tom83 »

Oh I found the save button now. But still can't enable remote access.

Image
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

Re: external database access / mysql

Post by tom83 »

Anyone? How do you guys connect mysql using external connection (like MySQL Workbench for example). Which steps should I make to make this external connection work?
User avatar
Enigma
Posts: 258
Joined: Thu 2. Aug 2018, 19:18

Re: external database access / mysql

Post by Enigma »

There's a configuration option for this within KeyHelp. I'm using the German version, but it should be something like Configuration > System > Database Server. The first option there allows external access.

It would be more secure to use an SSH tunnel, though. Several programs have this feature built-in; Navicat is a nice one, for example, but it's not free. You can use free tools like PuTTY to create a tunnel and then use any program with it.

Cheers,
Jan
This message has been ROT-13 encrypted twice for higher security.
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

Re: external database access / mysql

Post by tom83 »

Hi,

Thanks for answer. I've done this Configuration > System - Database Server > [X] Enabled Allow remote access, and also allow port on Firewall.

It doesn't work. I would need to connect without tunnel for an external server application that connects to this server's database.

Anything else should need to activate maybe?
User avatar
Martin
Posts: 984
Joined: Wed 20. Jan 2016, 00:43

Re: external database access / mysql

Post by Martin »

Hello,

there is also a third step needed: Within the setting of the specific database you must allow connections from your external host.
Viele Grüße,
Martin
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

Re: external database access / mysql

Post by tom83 »

Martin wrote: Fri 22. Nov 2019, 21:21 Hello,

there is also a third step needed: Within the setting of the specific database you must allow connections from your external host.
Hi Martin,

Thanks for answer. Wouldn't work the rule that I've made for any remote connection? Or did I made it wrong maybe?

Could you explain how can I make this rule exactly?

Really grateful.
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: external database access / mysql

Post by Alexander »

@tom83

I see a red box above your ACCEPT rule in your screenshot. It seems that your REJECT rule is above the MariaDB/MySQL rule, which leads to a rejection before it can be accepted by the MariaDB/MySQL rule. See the screenshot below for a correct order.

---

Summary of all required steps for admins looking for the same information in the future.

1. Step:
Enable MariaDB/MySQL to listen on the appropriate port.
"Configuration" -> "Database server" -> "Allow remote access"
x1.png

2. Step:
Enable the appropriate user to be able to use a remote connection.
"User-Administration" -> "Add user" / "Edit user" -> Tab "Resource & permissions" -> Scroll down to "Database remote access"
x2.png
x3.png

3. Step
Depending on your current Firewall rules this may be optional. Open the MariaDB/MySQL port in the firewall settings.
x7.png

4. Step
Within the user area of the user, who should be able to use remote database access, enable access to the appropriate database.
"Databases" -> "Add database" / "Edit database" -> "Remote access" and choose the desired option.
x4.png
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

Re: external database access / mysql

Post by tom83 »

Hi,

Thanks for all steps! I've made all those again, and I've changed the order (on firewall) like you said:
I see a red box above your ACCEPT rule in your screenshot. It seems that your REJECT rule is above the MariaDB/MySQL rule, which leads to a rejection before it can be accepted by the MariaDB/MySQL rule. See the screenshot below for a correct order.
And WORKED fine now.

ps.: I didn't know that the order on firewall rules would matter.... and it does.

Thank you! :)
Locked