PHP has a set time that is the maximum time any given script can run. You can change that with set_time_limit() though. The error is caused because the script ran for 300 seconds (5 minutes), which was the limit set by the script. There is no real "work around" for this, since it isn't your own script. (It's from PHPMyAdmin)
What were you doing that caused this error? Try re-doing it, the server could have been busy at the time which would have made the script take longer to run then it needed to be, thus the error.