?
Solved

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

Posted on 2007-10-04
7
Medium Priority
?
5,135 Views
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!
0
Comment
Question by:Marius0188
7 Comments
 
LVL 28

Assisted Solution

by:2266180
2266180 earned 400 total points
ID: 20020053
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: http://delphi.about.com/od/mysql/MySQL_with_Delphi.htm

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

Assisted Solution

by:CodedK
CodedK earned 400 total points
ID: 20020416
I also prefer ADO.
My favourite is AnyDAC component.
Donwload it. Its free. http://www.da-soft.com/content/view/45/145/
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.
0
 
LVL 3

Assisted Solution

by:Kunfufaresi
Kunfufaresi earned 400 total points
ID: 20034602
Hello,

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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
RuntimeError007 earned 800 total points
ID: 20068961
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: http://www.productivity.org/projects/tmysql/

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

Hope this helps.


0
 

Author Comment

by:Marius0188
ID: 20143599
Hi Guys,

The problem I have is that I do not have a static IP.
Will a service like www.no-ip.com help?
I have setup an account but it is not working. Any advise or suggestions on how to overcome this problem?
0
 

Author Comment

by:Marius0188
ID: 20143670
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!
0
 

Author Comment

by:Marius0188
ID: 20143682
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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

621 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