In the Piwik installation at the Database setup step, the host can be specified as:

  • hostname
  • IPaddress

You can specify a custom port number to connect Mysql (instead of default 3306):
* host name:port
* ipaddr:port

You can also specify to connect through a socket:
* /sock/path # anything before the slash is ignored
* localhost # localhost has a special meaning in php 5.3+; with mysqlnd, it means use the default sock path