Skip to main content
Maher Sakka
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

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
No content available.
Tags
  • Laravel
  • Linux
  • Drupal
  • Database
  • Tips & Tricks
  • Mobile
Recent posts
  • How to determine which Linux distribution and kernel version you are running
  • Send an email to multiple recipients at once
  • How to clear Drupal cache via database
Monthly archive
  • May 2017 (2)
  • August 2018 (1)
  • October 2020 (1)
  • August 2023 (1)
  • July 2024 (2)
  • November 2024 (1)
  • July 2025 (3)
RSS feed

mahersakka.com © 2024