MySQL
MySQL is a mature open-source relational database, widely deployed and the default behind a great deal of existing web software. MariaDB is the community fork created after Oracle’s acquisition and is largely compatible; which one is in front of you is usually decided by the distribution.
I do not choose it for new work, and the reason is narrower than a general judgment about quality.
Why Postgres instead
The decisive factor is extensions, PostGIS specifically. MySQL has spatial types and they are considerably less capable, and for environmental data that settles it before anything else is considered.
Beyond that, the differences are smaller than partisans suggest. Postgres has richer types and stricter behaviour; MySQL has historically been simpler to operate and very fast on read-heavy workloads. Both are entirely adequate for ordinary application work.
Historical caveats worth knowing
MySQL’s reputation for laxity comes from real behaviour that has largely been fixed, and the fixes are recent enough that existing systems may predate them.
Older versions silently truncated data that did not fit and accepted invalid dates like 0000-00-00, converting them rather than erroring. Strict mode is now the default and rejects these — but a database created before that, or configured for compatibility, may still be running the permissive behaviour. Checking sql_mode on an inherited system is worth doing before trusting what is in the tables.
The MyISAM to InnoDB transition is the other piece of history that still surfaces. MyISAM had no transactions and no foreign key enforcement. InnoDB is the default now, and old schemas sometimes still specify MyISAM tables, where constraints that appear to exist are not enforced.
DDL is not transactional. A failed migration can leave the schema partially changed with no rollback, which makes migration discipline more important than with Postgres and is a real operational difference rather than a stylistic one.
When it is the right call
When it is already there. Migrating a working system to Postgres for the reasons above is rarely worth it, and MySQL is a perfectly capable database for most application workloads. The case for switching is specific — spatial data, complex types, or transactional DDL — not general.
See also: PostgreSQL, SQLite, OracleDB, and ORMs.