#!/bin/perl use DBI; # Connect to target DB my $dbh = DBI->connect("DBI:mysql:database=mysql;host=localhost","root","root", 'RaiseError' => 1}); # query my $sqr = $dbh->prepare("SELECT user FROM user"); $sqr->execute(); while(my $ref = $sqr->fetchrow_hashref()) { print "$ref->{'user'}/n"; } $dbh->disconnect();
perl连接mysql测试脚本
最新推荐文章于 2023-10-01 04:37:13 发布