function drush_valid_db_credentials

8.0.x drush_valid_db_credentials()
6.x drush_valid_db_credentials()
7.x drush_valid_db_credentials()
3.x drush_valid_db_credentials()
4.x drush_valid_db_credentials()
5.x drush_valid_db_credentials()
master drush_valid_db_credentials()

Tests the currently loaded database credentials to ensure a database connection can be made.

1 call to drush_valid_db_credentials()


includes/, line 368
Functions used by drush to query the environment and setting the current configuration.


function drush_valid_db_credentials() {
  try {
    $sql = drush_sql_get_class();
    if (!$sqlVersion = drush_sql_get_version()) {
      return FALSE;
    if (!$sqlVersion->valid_credentials($sql->db_spec())) {
      return FALSE;
    return $sql->query('SELECT 1;');
  catch (Exception $e) {
    return FALSE;