Knowledgebase

Accessing your MySQL database with Perl  Print this Article

The Perl module, DBI.pm is a convenient way to connect to the database from within Perl scripts. Please read the documentation about DBI.pm. Full documentation for the Perl module use is available from this link

Please be advised that Mochahost can not support your custom programming or scripts.

Here are the basics of connecting: NOTE: substitute the following values in the script below:

$hostname = "localhost"

$database = the new database

$user = your username and $password = the password you set.

use DBI; $driver = "mysql"; $dsn = "DBI:$driver:database=$database;host=$hostname"; $dbh = DBI->connect($dsn, $user, $password);

Was this answer helpful?

Related Articles

MS Access
Does TechPlus support MS Access? MS Access is typically used in conjunction with Windows servers...
Maximum number of databases per hosting account
We provide different number of databases in each hosting account. You can check detail on each...
Do you support for MySQL 5.x?
Yes. We support for MySQL 5.x.
MS SQL - SAMPLE CONNECTION STRING (ASP.NET)
This is a sample connection string which you can use with MS SQL 2005 / 2008 under...
MS SQL Remote Management
We allow remote management/connections for our MS SQL database (Business and Mocha plans only)...