Skip to main content
Maher Sakka's Blog
Main navigation
  • Home
  • Contact me
Language switcher
  • English
  • عربي
Breadcrumb
  1. Home
  2. Blog
  3. How To Clear Drupal Cache Via Database

How to clear Drupal cache via database

Image
How to clear Drupal cache via database

It is usually not possible to clear the Drupal cache via the site administration or via the command:

 drush cache-rebuild

In this case the only way available is to clear the cache via the database with the command

 TRUNCATE

The question now is which tables should be flushed and which ones are cached?

All Drupal cache tables, whether kernel tables or module tables, start with the prefix "cache".

To directly flush all cache tables, use the following SQL commands, specifying the database name:

SET @DB_NAME ='my_databse_name';
SELECT concat('TRUNCATE TABLE ', TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = @DB_NAME AND TABLE_NAME LIKE '%cache%'

Then execute the resulting commands to unpack, making sure that you have selected the appropriate database for execution.

Tags
  • Drupal
  • Database
Related posts
  • How to bypass the "PHP Fatal error: Allowed memory size of X bytes exhausted" error in Drush
Tags
  • Laravel
  • Linux
  • Drupal
  • Database
  • Tips & Tricks
  • Mobile
  • Servers
  • SEO
Recent posts
  • How to bypass the "PHP Fatal error: Allowed memory size of X bytes exhausted" error in Drush
  • How to detect tables wihtout primary key in a database
  • How to know which ini configuration files are loaded with PHP
Monthly archive
  • May 2017 (2)
  • August 2018 (1)
  • October 2020 (1)
  • August 2023 (1)
  • July 2024 (2)
  • November 2024 (1)
  • July 2025 (10)
  • October 2025 (6)
  • December 2025 (1)
Projects
  • elmanager.tn
  • 365mathex.com
  • vpop.tn
  • toufoula.tn
  • writethemoney.com
  • dinartunisien.com
RSS feed

mahersakka.com © 2024 
Build Your IT Skills, Grow Your Wealth with Maher Sakka