#!/usr/bin/perl use 5.006; use strict; use warnings; use DBI; # Remote -Ziel-Datenbank (Zugriff funktioniert z.Zt. nicht) # my $dsn = 'dbi:mysql:dbname=username_1;host=die-zurhorsts.de'; # my $user = 'username'; # my $password = '*******'; # Lokale Ziel-Datenbank (Test) my $dsn = 'dbi:mysql:dbname=username_1;host=localhost'; my $user = 'username'; my $password = '********'; my $dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1, AutoCommit => 1 }) or die $DBI::errstr; print "2+2=",$dbh->selectrow_array("SELECT 2+2"),"\n"; $dbh->disconnect;