How to delete approx. 65 thousand transactions from a test environment software DB ? Im Using Heydi SQL along with MySQL 8.0

CLT2023's profile image CLT2023 posted 1 year ago in General Permalink

How to delete approx. 65 thousand transactions from a test environment software DB? Im Using Heydi SQL along with MySQL 8.0, and I tried many options, even increasing the execution time from a PHP file I created, it still was not getting enough time to delete all transactions according to the response coming from the WAMP server.

Fatal error: Maximum execution time of 2400 seconds exceeded in C:\wamp64\www\testtransac\clearadmin.php on line 32

Thanks in advance for all your help.

ansgar's profile image ansgar posted 1 year ago Permalink

Instead of deleting rows in a PHP script, you can also do that in HeidiSQL. HeidiSQL does not have a maximum execution time like PHP. For a larger amount of rows you should just fire TRUNCATE mytable; in a query tab. Note this deletes all rows in that table.

CLT2023's profile image CLT2023 posted 1 year ago Permalink

Hi, and thank you for your prompt response. can I run the truncate option only for specific data for example: TRUNCATE FROM tickets_detal WHEREID_TICKET = ETC? or how should I use it to delete data from that table?

Thank you.

ansgar's profile image ansgar posted 1 year ago Permalink

No, TRUNCATE is just for emptying an entire table. You want DELETE FROM tickets_detal WHERE ID_TICKET=...;.

Please login to leave a reply, or register at first.