PDO MySQL 5.6 Query Execution Timeout
Going through threads from 2009-2022 it doesn’t look like there has been a real answer on getting a query to timeout in PHP from MySQL (5.6). The PDO timeout attribute is for the connecting, not the execution. We don’t want all queries to stop executing after X seconds so the global MySQL variable can’t be used for this. We also don’t want the PHP script to stop running because the query took too long so max execution time on PHP side is ruled out.