If you are looking for a service with full root access at the fraction of the cost of a dedicated server consider utilizing Omnis virtual private server hosting platform

Connecting to MySQL with Perl

Can't connect to mySQL server: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


You must supply a hostname when connectiong to MySQL. The above error appears when attempting to connect to localhost. We have a dedicated MySQL server instead of overloading each individual webserver with their own instance of MySQL.

The following example code shows how to connect using perl:
$database = "yourdatabasename";
$username = "yourusername";
$password = "yourpassword";
$hostname = "mysql-host";
$dbh = DBI->connect("DBI:mysql:$username:$hostname", $username, $password);


We've been a leader in the web hosting industry since 1999.
Our focus on premier customer service, affordable prices, and maximum reliability has earned us a few awards.