Is it good to have multiple mysql databases hosted in multiple database servers for a PHP application??
I know programatically it is pain. But is it secure? will that make my application more flexible?
If you're using multiple of these databases simultaneously, it'll require connections to multiple servers as well, which could eventually cause it to be a bit slower. If you'll really notice this will depend on different factors, but I guess it's not ideal.
Security-wise it shouldn't matter much, and might even be less secure. More servers means more chances of one of them being compromised. But if you mean security as in making sure that your site won't go down, you could consider hosting all the databases on all of these servers, and let them sync with each other. That way, if one server goes down, you'll use one of the other servers. Or use multiple servers at the same time to balance the load.
There is nothing bad in having multiple mysql databases as well as in multiple hosts, as long as these things being used for sensible purpose.
There are no pains too, I don't understand what are you talking about.
But without any certain details the only answer you can get is "if you don't know what multiple databases for - you don't need them"