Cacti How to Solve PHP Fatal Error: Allowed memory size of {x} bytes exhausted (tried to allocate {y} bytes) in {$cacti_dir}/lib/adodb/adodb.inc.php on line {z}

If this error happened unexpectedly, it could be because of corrupted database tables.

We can fix it with this command from commandline:

mysqlcheck -u root -p --auto-repair --all-databases

And then when the command executed successfully you may run the database repair tool from cacti directory like that:

/usr/bin/php {$cacti_dir}/cli/repair_database.php