How to truncate MySQL tables from the CLI

How to truncate MySQL tables from the CLI

ATTENTIONThis method requires SSH access. Nexcess Classic (non-Cloud) clients 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

 

  1. Enter your password.

  2. 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 the Client Portal.

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to truncate MySQL tables in SiteWorx
Added on Mon, Dec 17, 2018
How to configure Magento 2 to use Elasticsearch
Added on Fri, Feb 22, 2019
How to show running MySQL queries in SiteWorx
Added on Mon, Dec 17, 2018
How to repair MySQL tables
Added on Fri, Sep 14, 2018
How to import and export MySQL databases in SiteWorx
Added on Mon, Dec 31, 2018
How to create MySQL databases with SiteWorx
Added on Mon, Mar 25, 2019
How to change permissions for MySQL users
Added on Thu, Dec 20, 2018
How to delete MySQL databases in Nexcess Cloud
Added on Thu, Dec 20, 2018
How to import and export MySQL databases in Nexcess Cloud
Added on Mon, Dec 17, 2018
What is phpMyAdmin?
Added on Mon, Dec 17, 2018