Delphi 7 :: Connect to online MySQL database hosted by hosting company?

Dear Experts,

I would like to know if the following is possible:

I would like to develop a Delphi app which can connect to my MySQL database on my website and manipulate the tables through my local desktop app.

If possible can you please tell me how and what parameters do I need for the connection.

PS: My site is hosted with a hosting company, so what will I require from them and what set up must they do on their side.

Thanks in advance!
Who is Participating?
If your host is on a linux server with cPanel you can set the permissions the allow your host by going to:

MySQL Databases --> Access Hosts and insert your host or range or just insert % which means allow connection from every Host (IP address) - (Not Recommended for security reasons).

As far as connecting to the mySQL database try this free components: TmySQL from:

Demo included. You can use the actual demo to test your connection!

Hope this helps.

it is possible, BUT
- the hosting company msut allow connection from your host for your user. they know how to do this but they will need your IP, which MUST be static. otherwise they will sure not agree to do this cine it would be a major security risk.
- then, it's all as simple as when you're connecting to a mysql on your local machine :)
here is a good link:

basically, I preffer using ADO via ODBC (you'll probably have to install the mysql connector if it wasn't installed on your machine before). it's simple and adaptable and more importantly, you can easily migrate to another DB server if you feel like it (easily, IF you are coding with this idea in your head, since some stuff that is mysql specific will somehow have to be translated to the specifics of the new DB)
anyhow, this is just my preference. you can choose any of the number of solutions presented in the above link.
I also prefer ADO.
My favourite is AnyDAC component.
Donwload it. Its free.
Then by double clicking the component that you dropped in your form you set the
username and the password.
You are ready to go.
Drop a query component and write your query.

Hope this helps.
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).


Basically all you need is hostip, username, password, port and database name to connect to just like on localhost. After a long serach I also finally settled on AnyDAC its the best one if ive found yet.
Marius0188Author Commented:
Hi Guys,

The problem I have is that I do not have a static IP.
Will a service like help?
I have setup an account but it is not working. Any advise or suggestions on how to overcome this problem?
Marius0188Author Commented:
Ok, I have that sorted. I am able to connect to my database using AnyDAC Database component.
But when running my project I receives the following error:

"Project Project1 raised exception class EADException with message '[AnyDAC][Phys]-300.
Driver [MySQL] is not registered.
To register it, you can drop component [TADPhysMySQLDriverLink] into your project".

I have dropeed a TADPhysMySQLDriverLink component  on my form but the error remains.

Any advise.

Thanks in advance!
Marius0188Author Commented:
Mmmh, I think got this one sorted as well. You can not running the project if ADConnection is open in design time. Need to do it in runtime with code.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.