It seems that there is a bug in cacti for centos x64 - version 0.8.7e
I have commented out line 41 in /var/www/cacti/lib/database.php which solves the problem (with the limitation of using the default MySQL port every time)
How can I report this so that others can recreate it. This happened on a production server, so I'm well, pretty pissed off actually! But hopefully sharing this info will help in the future
rpm -q --qf '%{vendor}' cacti
If you are using the rpmforge package, then please see
https://rpmrepo.org/RPMforge/Feedback
Alexander