The server and the client must agree on which port to use (the
settings are independent for client and server). If you are using
a host name of 'localhost' (case sensitive in this case, and *NOT*
the same thing as 127.0.0.1), the port isn't used but the path name
to a UNIX-domain socket is (and must be the same for server and
client).
The standard TCP port for MySQL is 3306. You should use this unless
you are running multiple instances of MySQL servers on the same
host, in which case the ports used by the different instances must
be different, and only one of them can have 3306.
This program is a MySQL client, and you'll need to set up a MySQL
server somewhere (possibly on the same host). It is generally
considered poor practice to expose your MySQL server port to the
world-wide Internet.