Link to home
Start Free TrialLog in
Avatar of RianaSteyn
RianaSteyn

asked on

Setting MySQL DatabaseName in Delphi for PHP

I am a fairly experienced Delphi and PHP developer but I am just starting to use Delphi for PHP. I want to develop an application that connects to a MySQL database (using Delphi for PHP). I have created the database using MySQL Query Browser say MyDB. the database has one table called tbClients with 4 fileds. I have registered the database in the Data Explorer tab in Delphi for PHP. I have followed the instructions described in the Help for "Creating a database application". I added a Database, DataSource, Query and DBGrid component to the unit. I set the DatabeseName of the Database component to "C:\Program Files\MySQL\MySQL Server 5.0\data\MyDB". When I run the application I get the following error "Application raised an exception class EDatabaseError with message 'Cannot connect to database server". I am supposed to see the data in the table in the datagrid - but I get the abovementioned error. Please help!!
Avatar of developmentguru
developmentguru
Flag of United States of America image

 Have you tried doing the same connection, from the same system, with a different tool?  It could be as simple as a firewall setting.  Is the server on the same system or a different system?  If it is on a different system (even a VM on the same system) can you ping the server?

  If you find that you have clear access to the server the next thing to look at is the user name / password.

Let me know what you find.
Avatar of RianaSteyn
RianaSteyn

ASKER

The database and MySQL server is on my local computer - no remote servers. I have managed to connect to the database and access the data from a PHP application. I just can not get it to work when I use the PHP for Delphi Database, Query, DataSource and DBGrid components.
Since I do not have Delphi for PHP or My SQL I'm afraid I can't be much more help.  I would expect that CodeGear made Delphi for PHP very similar to Delphi where they could.  I would start with the Database component and get it connected in the IDE.  If you can do that then get the query to work in the IDE.  Once the Query is working you should see the data on your grid within the IDE.  So...

Step 1: Connect the database.

Let me know if you get just that much to work.
ASKER CERTIFIED SOLUTION
Avatar of evault
evault
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial