VSB
VSB

Reputation: 10375

mysql table not decreased in size after deleting rows

I deleted 1M rows from a database table. Surprisingly its size did not decrease. Then I have tried: FLUSH TABLES; but whey I ran this statement on phpMyAdmin of my cPanel then I encountered below error:

#1227 - Access denied; you need (at least one of) the RELOAD privilege(s) for this operation

How can I decrease my table size and clear its cache?

Upvotes: 4

Views: 4931

Answers (2)

pkmiec
pkmiec

Reputation: 2694

Try optimize table command

OPTIMIZE TABLE <tablename>;

Upvotes: 9

Marc Delisle
Marc Delisle

Reputation: 9012

In phpMyAdmin, click on the database name to show the tables in the main panel. Then tick the checkbox next to the table name you want to decrease, and in the "With selected" drop-down under the list of tables, choose "Optimize".

Upvotes: 4

Related Questions