By default, the
mysqld daemon listens on TCP port 3306 for connection requests, so if your system has
mysqld installed and running, you can talk to it on that port.
By default, the command interface program,
mysql, tries to talk to a daemon on the same host (computer) that it is running on. You can change this by supplying the -h parameter to
mysql
Code:
$ mysql -h fubar.com
Similarly, you can specify the host that is supporting the daemon in various scripting languages by supplying either the name or IP address of that host in the database connect request.