delphi: connecting to hosted mysql server over internet - mysql

What is the most secure and effecient method of connecting a Delphi program to a MySQL database hosted on an Apache server from my web hosting provider.
Ideas, hints or any information regarding the above, preferably using dbExpress with Delphi 2010 will be highly appreciated.
Thanks

Well you cant connect directly because of the security issues but there are a couple,
Write a web-service that catches the request and send back you the
response.
write a php script that gets the requests and gives back responses.
if you are hosting on a windows server you can connect via VPN that
will give you a direct sql connection and still be secure.

You can connect directly MySQL Database. I recommend using FireDAC component.
About FireDAC :
FireDAC Multi-Device Data Access Library
Universal Enterprise Data Connectivity
FireDAC is a Universal Data Access library for developing applications for multiple devices, connected to enterprise databases. With its powerful universal architecture, FireDAC enables native high-speed direct access from Delphi and C++Builder to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, DataSnap and more.
FireDAC Data Access Components
Also you can use MySQL Data Access Components (MyDAC or UniDAC) :
About MyDAC Component:
MySQL Data Access Components (MyDAC) is a library of components that provides direct access to MySQL from Delphi, C++Builder, Lazarus (and Free Pascal) on Windows, Mac OS X, iOS, Android, Linux, and FreeBSD for both 32-bit and 64-bit platforms. Applications based on MyDAC can connect directly to MySQL server or work through the MySQL client library. MyDAC is designed to help programmers develop faster and cleaner MySQL database applications.
MySQL Data Access Components
If you want connect MySQL with dbExpress (i don't recommend it)
You need dbexpress driver for MySQL dbxmys.dll and alos MySQL client library libmySQL.dll.

I use MySQL as a remotely accessed DBMS from Go Daddy web hosting. Unidac is used to connect to the remote data set no problem. I then use a signed VCL component based GUI on the client side.
The VCL based GUI blows the doors off all other web based applications (including .NET). All the functionality of the Delphi application works flawlessly but I perform all DBMS functions to a remotely hosted MySQL database. I really appreciate this combination of technologies that allows me to produce the most robust applications possible.

Related

Firemonkey Mobile Application and remote MySQL

I am using Delphi XE5 and I have created basic Firemonkey Mobile Application - Delphi
I would like to connect to a remote MySQL database. Which if any database conduit do I use? (FireDAC, DBExpress, etc)?
You can use standard TSQLQueries, but as your mobile app needs to connect to a remote database, you will need to go via a DataSnap service (most probably hosted on an IIS server). The mobile device then connects to the DataSnap server which then connects to the database.
The DataSnap functions can return TDataSets which your app can then use.
You can take a look at Devart DAC
I'm using DBExpress since XE2, it works good, but i think now FireDAC is much bettter

Windows App with mySQL Backend

I am trying to design a database application for my small business. I've created a number of form driven MS Access databases for use before but would like to create a permanent solution in something more advanced & common.
I was thinking of using mySQL for the database and would then program a C# or VB application to be used in Windows. I do not want or need a web based version at this time but the migration to VB.net in the far future may be something I'll look into.
I know I can use a MS Access backend for my windows application without having to install MS Office on any or all the computers the program will be run for.
But here is my question. Is it necessary to install mySQL Server on the PC hosting the database, on all the PCs accessing the database or can I just use the database file as the backend and Visual Studio will have all the necessary tools I need to access it?
If I have to install the server I may just stick with the MS Access database as the needs for an excessive amount of database storage won't ever be an issue.
You'd need to install MySQL server on the Server hosting the database. The clients would then connect via the network. You will however need a driver to access the MySQL-Server with VB.NET on the client machines. A simple DLL-File might be enough, though.
If you are looking for a file-based database solution have a look at SQLite. But you will have to watch out for concurrency issues here.

Windows client - MYSQL server on linux

I have a Winforms desktop app that need to read/write data from/to a MYSQL database. The MYSQL server is on a machine that runs on Linux OS. I need to know if a .NET connector is to be used or an ODBC connector?
Also, considering that I do not need remote access to MYSQL server, is a connector sufficient to access the server from the windows desktop? Do I need to do something on the server side? I've been looking around and getting mixed signals, some people said a web service is required while others said no.
I need to know if a .NET connector is to be used or an ODBC connector?
I never connected to MYSQL before, but i think you can use these data provider or, ODBC too.
Is a connector sufficient to access the server from the windows desktop?
Yes. A valid address to your server is all you need to access it, using data providers or ODBC. Of course, your database need to be up and running too.
Do I need to do something on the server side?
Just install your MYSQL database.
Maybe this link will help you.

Flash Application with local database (not sqlite, not air)

I would like to have a Flash Application (not air) to connect to a local database.
Air is not only getting unsupported by Adobe in LINUX but besides, it has serious problems and miss implementation with SQLite.
So we want to connect to a local MySQL database.
This application should be simple, so we do not want to also have an unnecessary web server (also local) to make a middle communication between the flash app and the MySQL server.
There is this driver that allow to communicate Flash with MySQL
http://code.google.com/p/assql/
Question is:
Is this the best approach?
Would it be any problem using this approach when installing the whole application to each client? (because we also in the installation should install a MySQL server).
A MySQL SERVER is called a SERVER for a reason: It is meant to be installed on servers, not on clients. So the answer to your question is:
1) No, this is not the best approach. Not even close. You would be better off using a SQLite database (however shitty you may think it is)
2) Yes. Nobody would like installing a MySQL server on their computers just for the sake of running your application. Think of casual (non-expert) users who would need to install and configure the server just for running your app. That is the very REASON why they developed SQLite and so many languages support it.
You should check out http://code.google.com/p/air-sqlite/ for sqlite access in AIR (I don't know if this is the same as the inbuilt code or not, so just check that out)

What is the best way to connect to a Mysql database in Delphi

What is the best component to use when connecting to a Mysql 5.1.x in Delphi and why ?
No other DB components could beat DevArt DB Components, they have MyDac and UniDac, both of them could use direct access to the database without requiring mysql client to be installed on the client machine, beside they offer fast performance and high quality compared to other components
Data Access Components for MySQL
Universal Data Access Components
and check the pages above to know why ;-)
You should take a look at AnyDAC, supports MySQL and a lot of other databases.
Devart and microOLAP both offer components to access MySQL databases. Devart also have dbExpress drivers for dbExpress users.
Bob Swart has published Delphi for Win32 VCL Database Development on Lulu, if you need any help.
Don't forget that MySQL's client dll are GPL-ed, and if you are using it to connect to server, your app must be GPL-ed.
There are alternatives. Components that connect directly to MySQL skipping GPLed dlls. DevArt has such components (direct and dbx), and there are free components that can connect directily on tory.net.
I don't use MySQL, but when I can, I prefer dbExpress. It's unidirectional, which makes it pretty fast. Though I haven't done any benchmarking recently.
If dbExpress isn't your thing, I found this list of components for MySQL access.