To export a MySQL database using PHP, you can use the mysqldump command-line utility or the mysqli extension.