Connect to MySQL on WWW

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
monday
Posts: 3
Joined: Tue 04 Nov 2008 08:43

Connect to MySQL on WWW

Post by monday » Tue 04 Nov 2008 09:02

Hello all
I am am trying to write a delphi program which allows users to connect to their MySQL database which is located on my wwww host.

How can I do that? .....Tutorial is appreciated, The demo is to confusing and putts everything in one program ... IT IS A BIG MESS .... needs to be done all over again and in steps to help beginners like me.
Thank you

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: Connect to MySQL on WWW

Post by eduardosic » Tue 04 Nov 2008 11:40

monday wrote:Hello all
I am am trying to write a delphi program which allows users to connect to their MySQL database which is located on my wwww host.

How can I do that? .....Tutorial is appreciated, The demo is to confusing and putts everything in one program ... IT IS A BIG MESS .... needs to be done all over again and in steps to help beginners like me.
Thank you
is easy... put a TMyConnection, set the property Server = www.thesite.com
or the ip of site. set the properties Database, user and Password.

please, check if the www host allow external connections.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 04 Nov 2008 13:40

To connect to MySQL server you should use the TMyConnection component and set the following properties:
Server, Port, Database, Username, Password.

The MyDAC demo projects consist of one large project, but working with every components is included in separate directory and unit. You can click on the "Demo source" button in the MyDacDemo toolbar to find out how the demo you have selected was implemented.
You can find more detailed information about it in the "Getting Started" topic of MyDAC Help.

monday
Posts: 3
Joined: Tue 04 Nov 2008 08:43

Post by monday » Tue 04 Nov 2008 16:18

I did but it doesn't work...
This what I did

on the new form I put a
* MyConnection1 & MyConnectiondialog1 & Button
*in the properity of MyConnection1 I set the following
ConnectDialog = MyConnectiondialog1
protocol = mpTCP
server = www.mysite.com
database = MyDB
user = userDB
pass= passDB

* in the click event of the button
MyConnection1.connect;

Note:: I created a database on my site named MyDB
I add a user to MyDB named userDB ,, the password for the user is passDB


ALL OF THIS AND IT DOESNT CONNCECT I GET AN ERRR ...
HELP PLEASE

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Tue 04 Nov 2008 17:49

monday wrote:I did but it doesn't work...
This what I did

on the new form I put a
* MyConnection1 & MyConnectiondialog1 & Button
*in the properity of MyConnection1 I set the following
ConnectDialog = MyConnectiondialog1
protocol = mpTCP
server = www.mysite.com
database = MyDB
user = userDB
pass= passDB

* in the click event of the button
MyConnection1.connect;

Note:: I created a database on my site named MyDB
I add a user to MyDB named userDB ,, the password for the user is passDB


ALL OF THIS AND IT DOESNT CONNCECT I GET AN ERRR ...
HELP PLEASE
Please,

1 - check if the host "www" allows external connections and if uses the port 3306. you can obtain this information with you host administrator
2 - check if the user "userDB" can connect to a external network..
field Host in User Manger, set to % to allow external connection

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 05 Nov 2008 10:49

monday wrote:I did but it doesn't work...
This what I did

on the new form I put a
* MyConnection1 & MyConnectiondialog1 & Button
*in the properity of MyConnection1 I set the following
ConnectDialog = MyConnectiondialog1
protocol = mpTCP
server = www.mysite.com
database = MyDB
user = userDB
pass= passDB

* in the click event of the button
MyConnection1.connect;

Note:: I created a database on my site named MyDB
I add a user to MyDB named userDB ,, the password for the user is passDB


ALL OF THIS AND IT DOESNT CONNCECT I GET AN ERRR ...
HELP PLEASE
Please, give a detail description what error does arise?

Post Reply