DBI and DBD-mysql module installation, DBI installation wget http://www.cpan.org/modules/by-module/DBD/DBI-1.604.tar.gztar-zxvf DBI-1.604.tar.gzcd DBI-1.604perl Makefile. PLmakemake testmake install 2. install yum-y intall mysql-devel on DBD. Pay attention to the mysql environment variables, if not, add/usr/binl/mysql to the environment variable PATH/usr/binl/mysql: $ PATH; export PATH (enter the mysql installation PATH based on the actual situation) wget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.006.tar.gztar-zxvf DBD-mysql-4. 006.tar.gz cd DBD-mysql-4.006perl Makefile. PL -- mysql_config =/usr/bin/mysql_configmakemake testmake install test connection :#! /Usr/bin/perluse DBI; $ user = "test"; $ passwd = "test"; $ dbh = ""; $ dbh = DBI-> connect ("dbi: mysql: database = test; host = 192.1.1.168; port = 3306 ", $ user, $ passwd) or die" can't connect todatabase ". DBI-errstr; $…… = $ dbh-> prepare ("select * from infobright_loaddata_status"); $……> execute; while (@ recs = $……-> fetchrow_array) {print $ recs [0]. ":". $ recs [1]. ":". $ recs [2]. "\ n" ;}$ dbh-> disconnect;