In the connection file, what have you entered for the mySQL Host name?
try adding ":3306" at the end. so if you set the mySQL hostname to "localhost" change it to "localhost:3306"
the headers already send error means there is blank space between closing php tags "?>" and an opening php tag "<?php"
look for blank lines between php tags on the index page around line 5.