You need to tell Cacti where to find the database and which credentials it should use to access it. This is done by editing the config.php file in the include directory.