If you want to access a MySQL database with Perl, you will have to use DBI module. All of the exported functions and constants are included from the DBI module necessary for your script to access your database when you use DBI module to access MySQL database.
Follow the steps given below to access MySQL database on your Linux Dedicated servers :-
1) Login to your Linux web server using Secure Shell.
2) Type the following at the prompt to include the DBI module in your script:
use DBI;
3) Type the following connection string to connect to your database:
$connection=DBI-
>connect("DBI:mysql:database=$database;host=$host:port=3306",
$username, $password);
> $database: enter the name of your database
> $host: enter the name of the MySQL server that you are assigned to, for example,
mysql4.dedicatedserverhostingonline.com
> $username: enter the username provided for your database
> $password: enter the password provided for your database























Tweet This
Leave a Reply