We’ll use the following useful script as file db-connect-test.php to do a quick PHP MySQL DB connection test. Change the database name, database user, and user password, as well as the host, to the settings you choose. The file should be saved and closed. It should now print the total number of tables in the given database if you execute it as follows.