How to re-connect WP files in lampp/htdocs to new SQL database to recover site under development

First time here, facing a bigtime wordpress situation. My Ubuntu installation crashed beyond repair during upgrading version. Managed only to copy the wordpress files, installed in /opt/lampp/htdocs, cause I’m developing in localjost.
There was no salvage of mySQL directory in Ubuntu installation, as it was beyond my skills in cli-linux, so it is gone for good…

What have tried so far, is creating a new database with same name as the old one, and copied wp-config.php and all files to the folder where reinstalled wordpress. I get “Error Establishing a Database Connection”.

Is there anything to be done, e.g recreating database with same name in mySQL to link wp-config or wp-content, and link WordPress file folder to new database?
Furthermore, if it is possible to link wp files to a new database,how to access site with all passwords lost?

Please inform me, before starting over the development of the site.

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com