Does wordpress update overwrite wp-config.php file?

No. When you download wordpress first time, it doesn’t include wp-config.php file. During wordpress installation, it creates wp-config.php file in the root directory of your wordpress site. Later, you can customize it by adding any code into it like I explained in my last article.

When wordpress is updated, it doesn’t overwrite wp-config.php file.

Note: Always, backup your customized files before doing any update.