6

This question may be very easy but I really cannot find a real answer online. I already know that I can connect to a sqlite database stored in my computer with FireDac but now I want to move on an online sql server.

I own a domain with a sql server inside.

enter image description here

This is my configuration and it tells me Unknown configuration host. I need to connect to my sql database online. Is FireDAC the real solution?


I have this kind of connection string server-side:

$pdo = new PDO('mysql:host=mysql.netsons.com;dbname=caorobwq_worldcup', 'username', 'password');
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Raffaele Rossi
  • 2,997
  • 4
  • 31
  • 62
  • 2
    Have you checked that the SQL server is reachable from outside? This is usually not the case for the average website due to security reasons. – Uwe Raabe Sep 21 '16 at 07:02
  • 1
    Can you connect to the MySQL server using the command line client? NB default installations of MySQL only allow connections from the local machine, not a remote client. You should consider the security implications of connecting remotely. – Jaydee Sep 21 '16 at 12:34
  • 1
    I use FireDAC quite a bit for connecting to servers on my network and it works well. – Jaydee Sep 21 '16 at 12:35
  • 1
    As Uwe says, this is not how it is usually done. Normally, you would have an app on that server which is all that is allowed to conenct to the databse, and clients would communicate with that I recommend a RESTful interface). – Mawg says reinstate Monica Mar 01 '17 at 08:31

1 Answers1

2

You can connect to such server, but you should not expose it this way. Create another, application layer that will use your database server as a local storage. It's called three tier architecture.

enter image description here

Victoria
  • 7,822
  • 2
  • 21
  • 44