There are database abstraction layers (frameworks) available for php (that's a year or two old), which can reduce the dependence on a particular database, as can frameworks such as cakephp.
Rummaging around over at php.net might find some discussions of folks with opinions on this topic, too; I'd expect to find at least a couple of opinions on this topic over there.
There are tools around that can allow a view into the databases, too. Sequel Pro, InductionApp and various others are around. (If you choose, load and use a web-facing tool such as phpMyAdmin, make sure it's always locked down against the inevitable attacks.)
As for your question and your databases, MySQL (and the MariahDB fork) are common choices. MySQL was part of OS X Server through Snow Leopard.
Apple has moved off of MySQL with OS X Server Lion; they're now using PostgreSQL as the OS X Server database.
SQLite is also available on most any recent version of OS X, and intended for (and very good at) single-user and embedded applications.
Irespective of which database(s) you pick to learn, spend some time learning about cross-site scripting and SQL injection; these are common ways that web-facing code (and its underlying databases) are attacked.