Nexcess Logo

How to Truncate MySQL Tables From the CLI

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
September 11, 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.

MySQL Truncate Tables from the CLI Step #1


1. Log in to your hosting account using SSH:

mysql -u [username] -p [database_name)


MySQL Truncate Tables from the CLI Step #1 - Example


For example:

mysql -u johndoe -p data_mysite


MySQL Truncate Tables from the CLI Step #2


2. Enter your password.

MySQL Truncate Tables from the CLI Step #3

3. Execute:truncate table [table_name]

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.

Not a Nexcess Customer Yet?

Get faster speeds on Nexcess servers and fully managed hosting plans. Stronger security, scalability, and 24/7/365 award-winning hosting support are just a few of the reasons why people choose Nexcess.

Check out our plans or contact us to get started today.

Jason Dobry
We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.