Hi
First use the myConnection component. For testing click the right button and choose for CONNECTION EDITOR.
Now set server, port, username, password, database and click DIRECT. I put the myConnection on the MainModule.
Then you can use a datamodules with TQuery components and set tMyQuery.Connection to the TMyConnection component.
In code it's about the same:
myConnection.Server :=''you're ip address''|;
myConnection.port= 3306;
myConnection.Username := 'username';
myConnection.Password := 'password';
myConnection.Database :='databasename';
myConnection.Connect;