I suggest a failure plan to prepare for security failures including several PR messages depending on severity of failure even if you do not know if you're compromised.
It's highly unlikely that you will be able to avoid potential leaks.
I guess, as always, there is no silver bullet.
Maybe you want decentralised permissions of multiple database users? They can't quite get or do most things.
Or centralised and/or put into a locked down file that can only be accessed by the OS user for parsing scripts eg www-data.
More references:
http://technet.microsoft.com/en-us/library/cc722487.aspx#EIA...
http://us.php.net/manual/en/security.php (Or check your relevant manual)
http://blogs.forbes.com/firewall/2010/12/13/the-lessons-of-g...
http://stackoverflow.com/questions/3173698/how-safe-is-code-...