What are the best practices for establishing a PDO connection to a MySQL database in PHP MVC architecture?

Establishing a PDO connection to a MySQL database in PHP MVC architecture is a common task that requires careful handling to ensure security and efficiency. It is best practice to create a separate database configuration file to store connection details and include it in your MVC framework. This helps to centralize database settings and make it easier to update them in the future.

```php
// database.php
<?php
$host = 'localhost';
$dbname = 'my_database';
$username = 'root';
$password = '';

try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Connection failed: " . $e->getMessage());
}
```

In your MVC framework, you can include this database configuration file at the beginning of your application to establish a PDO connection to your MySQL database. This ensures that your database connection is secure and follows best practices for PHP MVC architecture.