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

Posted on 2007-10-04
Last Modified: 2013-11-23
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!
Question by:Marius0188
    LVL 28

    Assisted Solution

    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.
    LVL 16

    Assisted Solution

    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.
    LVL 3

    Assisted Solution


    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.
    LVL 1

    Accepted Solution

    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.


    Author Comment

    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?

    Author Comment

    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!

    Author Comment

    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.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now