PDA

View Full Version : Acces to a remote mysql server



Alienxs
18th August 2006, 16:58
i have a question if i have a LAN based on three computers and suppose computer1 has a mysql db and i want to access to it from computer2 all i have to do its put "computer1" against "localhost" on setHostName that´s all??

i mean:

my_connect->setHostName("computer1");

against
my_connect->setHostName("localHost");

wysota
18th August 2006, 17:06
Provided that "computer1" is a valid address resolvable through DNS (or other mechanism your network uses), then yes. But basicaly it should be safer to use an IP address of the remote box.

ball
19th August 2006, 03:10
Yes, using IP address is better since it do not need to resolve host-name. Also, remember to add firewall access of port 3306 in the computer that has MySQL server installed.