MyConnect parameters (server and database)

MyConnect parameters (server and database)

Postby natilus » Sun 12 Mar 2006 15:46

Hi

This is a really noob question. but how do I establish a connection to mySQL server? Im using MyConnection but I dont now how to set the appropriate parameters.

I got 2 questions:

1. MyConnection->Server = "?????"

Should this be the path where mySQL .exe file resides?
Like this "......mysql//bin//mysqld-nt.exe"

2. MyConnection->Database

This this be path where my database exists?
I have a database called "Test" and a table called "friends".

When looking into the folder that contain my database I found 3 files.

friends.frm
friends.MYD
friends.MYI

Which one should I use and how should I type it?:
MyConnection->Server = "mysql\data\test\friends.frm" ????????

Please help someone, this should really be a simple problem!

Best regards

Jonas
natilus
 
Posts: 2
Joined: Sun 12 Mar 2006 15:31

Postby swierzbicki » Sun 12 Mar 2006 19:29

Dont worry there is just noob answers ;)

1. MyConnection->Server =

You have to put here your mysql server Ip address , if you have installed mysql on your Pc just put "localhost" or "127.0.0.1"

2. MyConnection->Database =

In your exemple there is two databases : Test and friends
To use the awaited database put either "test" or "friends"
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby natilus » Sun 12 Mar 2006 21:52

Ok thanx.

But when setting:

MyConnection->Database ="a mySQL database" in my case "test". How does the program know where to find my mySQL database "test"?

I have used ODBC before, using ODBC U have to attach a DSN to a database. But know it feels like the program have no idea where this "test" database resides.

Shouldn't I include a path where my database is?

/Jonas
natilus
 
Posts: 2
Joined: Sun 12 Mar 2006 15:31

Postby swierzbicki » Mon 13 Mar 2006 08:00

You don't have to include any path. The MySQL server which you are connecting knows everything about the existing databases / tables and so on... MyDAC component is sending requests to the MySQL server. If you want, the MySQL server is working between your Application and your Database files...
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59


Return to MySQL Data Access Components