What are the key differences between using "localhost" and a specific host name in the $hostname_conn variable when establishing a connection to a MySQL database in PHP?

When establishing a connection to a MySQL database in PHP, using "localhost" in the $hostname_conn variable will connect to the MySQL server running on the same machine as the PHP script. On the other hand, using a specific host name will connect to a MySQL server running on a different machine. It is important to choose the appropriate option based on where the MySQL server is located.

// Using "localhost" to connect to a MySQL database running on the same machine
$hostname_conn = "localhost";
$username_conn = "username";
$password_conn = "password";
$database_conn = "database";

// Using a specific host name to connect to a MySQL database running on a different machine
$hostname_conn = "specific_host_name";
$username_conn = "username";
$password_conn = "password";
$database_conn = "database";