How to solve Fatal error: Maximum execution time of 300 seconds exceeded in Drupal installation on line 171?
Maybe you're doing it first time. So, you have confused Apache port with mysql port.

You can see, I have started Xampp, here I am running Apache, with http and https, in ports (80, and 443) now according to the availability of ports in your pc, you can change them
Now, comes the database i.e. MySQL, whose port is normally 3306, or you can change to something else, according to your availability.
During Drupal installation. The database port which you have put as 8080, will be 3306, if you have not changed it either, which you can check from your xampp control panel, as I have added screenshot.
Now, as apache is running on port 8080, then your site will run on localhost:8080/<folder-name>, by default apache port is 80 which is omitted by browser, if that changed to anything else, which requires to be mentioned on http address

Fatal error: Maximum execution time of 300 seconds exceeded on line 171
I am new in the world of drupal My port no.80 is assigned to my ASP server so I changed my Apache server from 80 to 8080 in httpd.conf , BTW I am using XAMPP server I got Error "Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\htdocs\MyDemoWebsite\core\modules\mysql\src\Driver\Database\mysql\Connection.php on line 171" while install site after Set up database in core instal Set up database Image
Maximum execution time of 300 seconds exceeded in
May be I am doing somthing wrong in Set Up Database enter image description here   I have tried by changing the port no. to 8080port no. to 8080
