• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1604
  • Last Modified:

Delphi & MySQL

I am trying to build an app using MySQL and of course Delphi with Zeos components.
So... I need to deploy my application to my client that has a small LAN and will be using my app on all the computers. One of the computers will be the server for my MYSQL database and the rest of the users will access the DB through LAN.
So far I used MS ACCESS for my apps and used ODBC. Now with Zeos I connect directly to the MYSQL database so there's no need for ODBC :)
My problems are
1... Do I need to build 2 different apps (one for use on the server and the other for the use on the rest of the LAN members) ?
2... If so... then what settings do I need to make on the server/(and)or the client to make it work.
        (rigth now it tells me that "host 192.168.0.25 is not allowed to connect to this MYSQL Server" where the host is the workstation not the server, and the MySQL server is on a Windown XP)

To be short tell me what should I do to be able to connect to my MySQL server that is installed on an XP from a Win98 from LAN running a ZeosLib powered delphi application. I repeat I am no expert in MySQL.
Please...
0
Ghitza
Asked:
Ghitza
1 Solution
 
Wim ten BrinkCommented:
You're trying to create a multi-tier application and you're going to implement the communication between client and server yourself? Well, good luck because that's a task of herculean proportions. I think even Herculus would prefer to clean some dirty stables than choose for this solution.

First of all, you will have to work on at least two projects. First of all the client application that will just be a simple executable that connects to the server. And then the server application that could be a simple executable too. But it could also be a system service running in the background. Or a COM+ component that's installed in a COM+ application. Or even a webservice application combined with IIS so you could easily access the data through the SOAP API's.

The settings you'll need depend completely on your environment and the server solution that you choose. I think the easiest way would be by creating a webservice, although Delphi has some few flaws in it's webservice implementation. (Datetime and booleans are wrongly implemented.) But a webservice just integrates with IIS and just requires you to connect to the server as if it's a webpage. Your client would have to implement some SOAP client stuff but it could easily do this since Delphi 7 has some nice wizards for this.

If you use these techniques then technically, your clients won't need the ZEOS libraries. But you will have to find a way to send over the datasets from the server to the client. Midas might be useful. Or just create your own protocol to send over the data.
0
 
GhitzaAuthor Commented:
Nothing that big...
I only want to replace my Access database with MySql database. I already have the application that is running just fine with ADO and MS ACCESS. But considering the price for the MSAccess licence and the one for MySql :).... and not to forget that MySQL is a lot faster that Access I decided to migrate my application to MySQL. So practicaly this is what I need. Help migrate my application , and configuration for the MySQL in order to force it to accept incomming connection from LAN.
My Application does not use web. It's a simple app that connects to a mdb and makes updates, inserts, selects on it returning datasets or not.
   Sorry if my english made you understand my question wrong.
I am still waiting for someone that need my points :)
I am sure there must be someone out there that did the same thing.... (I hope)
0
 
eyeh8uCommented:
You simply need to grant some privileges to the user your application connects as to connect from multiple hosts.

See the GRANT command in the MySQL Manual: http://dev.mysql.com/doc/mysql/en/GRANT.html
Example: http://forums.mysql.com/read.php?11,765,815#msg-815

You can use '%' as the host name to allow the user access from any host.
0
 
calinutzCommented:
Use MySQLCC on the server from the MySQL website, and on the User administration... right click on it... and choose new user. A new page will appear. Username... your username, host ... your remote host. On the new page choose the rights you want to give to the user, check the "with Grant option" on the bottom of the page, and on the right of the page check the databases you want to allow access to your user.
Then Apply and Close.
 You will be able to connect from the remote host to your server now.
Cheers
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now