Skip to content

Instantly share code, notes, and snippets.

@jaygaha
Created December 24, 2024 05:15
Show Gist options
  • Select an option

  • Save jaygaha/025d66cb3b6a6518369eb5c1aaffa740 to your computer and use it in GitHub Desktop.

Select an option

Save jaygaha/025d66cb3b6a6518369eb5c1aaffa740 to your computer and use it in GitHub Desktop.
Purge Laravel large telescope entries

Delete Laravel large telescopes_entries.ibd

Delete large data table files in MySQL while using Laravel Telescopes

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE telescope_entries_tags;
TRUNCATE TABLE telescope_monitoring;
TRUNCATE TABLE telescope_entries;
SET FOREIGN_KEY_CHECKS = 1;

Purge MySQL Bin log Files

How to clear MySQL bing log files:

The following command will delete all logs prior to the log file mysql-bin.0002

PURGE BINARY LOGS TO 'mysql-bin.0003';

The following command will delete all logs before 2024-12-25 12:30:00

PURGE BINARY LOGS BEFORE '2024-12-25 12:30:00';

The following command will delete all logs till now.

PURGE BINARY LOGS BEFORE now();

Adding the following lines to the MySQL configuration file will allow the MySQL server to automatically purge logs older than 14 days, saving you the trouble of doing it manually.

expire_logs_days = 14
max_binlog_size = 100M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment