perldoc DBD::mysql
That being said, your DSN passed to connect isn't
properly configured. DBD::mysql requires a different syntax
in the connect statement requiring hostname and database
instead of simply naming the database you wish to use.
Assuming the mysql-server is on the same box as the
script, try:
$dbh = DBI->connect("dbi:mysql:database=test;hostname=localhost", "username", "password", {RaiseError => 1});
The RaiseError is just good use of available attributes
of the DBI. Read perldoc DBI for more and what
they do.
ALL HAIL BRAK!!! |