Cgi script that accesses a database

Connecting to database
Access denied for user 'karl'@'localhost' (using password: YES)