The DBI module and the MySQL DBD module are definitely what you need here.
They're very widely used and certainly work just fine. There's very little point in trying to make your own module to do the same job as these.
is the appropriate section in the CPAN module list for what you want to do here. More specifically you'll need this module
and this driver
If you're having any trouble installing them, just say so and people will be happy to help I'm sure.