How to pick the default selected value in wordpress dropdown?

To set the default value for the category dropdown, you need to pass it as a parameter for the function. Like so,

$dropdown_args = array(
  'selected' => 2,
);
wp_dropdown_categories( $dropdown_args );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)