Accessing your MySQL database with Perl

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: http://search.cpan.org/doc/JWIED/Msql-Mysql-modules-1.2214/mysql/lib/DBD/mysql.pm

Please be advised that ChromeIS 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);

  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Související články

What is the default mysql port?

3306 is the default mysql port.

How to connect to PostgreSQL from PHP?

For connecting to a PostgreSQL database from PHP you can use the standard pg_Connect() function.

How to import an .sql file into a Postgre database?

Log in to your cPanel and open the phpPgAdmin tool. Then click on the PostgreSQL link at the left...

How to create a Postgre user?

In order to create a PostgreSQL user you should go to your cPanel -> PostgreSQL Databases...

How to create a Postgre database?

Creating a PostgreSQL database is a straight-forward process. All you need to do is log in to...