Logo Knowledge
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  1. Acquia Support Knowledge Base
  2. Troubleshooting
  3. Common Problem

Truncating a large database table

    See more
    • Updated
    • November 19, 2020 09:35

    Issue

    One or more tables in your database are too large and need to be reduced in size. For information on assessing your disk space usage see About disk storage in Cloud Platform.

    Resolution

    Before attempting to reduce the size of any database, it is important that you make a backup as is best practice. Please take a look at our Backing up your Drupal database documentation. 

    After you have backed up the database, you could use the following command to connect to your database, replacing [site-uri] with the base URL to the website you want to connect to:

    drush sqlc --uri=[site_URL]

    Important

    Make sure to include the URI flag (especially if you have a multisite application) to ensure that you are connecting to the correct database. For example:
    drush sqlc --uri=www.acquia.com

    Now that you have a backup, are connected to the correct DB and know which table needs to be truncated (table_name), run the following command:

    TRUNCATE TABLE table_name;

    For example, if the table you needed to truncate was cache_container.idb, you would run this command

    TRUNCATE TABLE cache_container;

    For more information on truncating a table, please see Managing Large Cache Render tables in Drupal 8, which outlines how to truncate the cache_render table in particular, for Drupal 8. 

     

     

    Acquia Products

    • Acquia Cloud Platform

    Topics

    • database

    External Links

    • About disk storage in Cloud Platform
    • Backing up your Drupal database
    • Managing Large Cache Render tables in Drupal 8
    Avatar
    Daren Schaad
    • November 19, 2020 09:35
    • Updated
    • Facebook
    • Twitter
    • LinkedIn

    Was this article helpful?
    1 out of 1 found this helpful

    Return to top

    Related articles

    • Managing Large Cache Render tables in Drupal 8
    • Pipelines Error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.sessions' doesn't exist
    • Block unwanted IP addresses from accessing your site
    • Upgrading your database(s) to MySQL 5.7
    • "You are not authenticated to view this page" 401 error when accessing Metrics on Google Chrome

    Support

    Acquia Support Knowledge Base
    • Submit a Request
    • Contact Support
    • Acquia Support Guide
    • Product Documentation
    • System Status

    About Acquia

    • About Us
    • Leadership
    • Board of directors
    • Newsroom
    • Careers
    • Customers
    • Contact Us
    53 State Street, 10th Floor
    Boston, MA 02109
    United States
    Phone: 888-922-7842
    Map: Google Maps
    View other locations
    • Feeds
    • Legal
    • Security Issue?

    Copyright © 2018 Acquia Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.