#!/usr/bin/perl use strict; use warnings; use DBI; #server my $host=''; # DB-Name my $database=''; # Login Benutzer my $user=''; # Login Passwort my $pass=''; my $dbi=DBI->connect( "DBI:mysql:database=$database;host=$hostname", $user, $pass, { # script bei Fehler beenden RaiseError => 1, # Änderungen automatisch übernehmen # (macht das schreiben langsamer) AutoCommit => 1, }, ) or die("ERROR Connect DB".$DBI::errstr."\n"); my $sth = $dbh->prepare('Select * from vicidial_agent_log_temp order by user, event_time'); $sth->execute(); while(my $data=$sth->fetchrow_arrayref) { print join(', ',@$data)."\n"; # mehr code ... } $sth->finish; $dbh->disconnect;