How to truncate MySQL tables from the CLI

    October 17, 2019

    This method requires SSH access. Nexcess clients on physical non-cloud servers must first enable SSH access and adjust their firewall settings in SiteWorx; Cloud accounts have SSH enabled by default.

    Use the following procedure to perform the truncate table operation using the MySQL CLI:

    1. Log in to your hosting account using SSH:
      mysql -u [username] -p [database_name)
      For example:
      mysql -u johndoe -p data_mysite
      
      
    2. Enter your password.

    3. Execute:
      truncate table [table_name]

    Other resources

    For the complete MySQL documentation, refer to the MySQL website


    For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

    Was this article helpful?

    Send feedback

    Can’t find what you’re looking for?

    Our award-winning customer care team is here for you.

    Contact Support