There are some minor security implications, but no real way to get around them short of having your own server.
With shared hosting (unless it’s been configured by highly competent professionals, which I’ve never seen on a shared hosting server) anyone else with an account on that server can access your files. It’s that simple…also, since they have an account on the same server, they can access your MySQL database with the password in the file. Since the web server process has to be able to read the file to display your blog, generally every other user is able to as well. Sometimes changing the group of the file to the same group the web server process runs as (usually nobody or www-data), and then chmodding it to 750 will work, but often it does not.
The other thing is that even if I were to somehow obtain your MySQL details, I wouldn’t be able to connect to (assuming it’s properly configured) the server since the MySQL server wouldn’t be exposed to the network. I’d need an account on the server to do that. Fact is, though, that the PHP is parsed server-side and unless there are ‘echo’ statements in it echoing your database details, it’s not going to output anything whatsoever to a user on the internet.
For most, though, these are non-issues. Most people on shared hosting aren’t knowledgable enough to attempt an attack (not to mention don’t care). The only way to be assured of your security is to have full control of the server, period. The happiest medium for most users is a virtual private server or UML session, but the cost is significantly more than shared hosting, and they take some *nix skills to manage.