Edward
Edward

Reputation: 3081

Dropping a large mysql table

I have a table with over 3 million records, I tried dropping it in MySQL Workbench, it freezes every-time, I logged into sql command prompt through my shell and did

drop table table_name

it froze.

I tried deleting the records in the table

Delete from table_name where `ID` > 100000;

it froze

I thought maybe I'd let it run for awhile after two hours it's still running:

How can I delete this table?

Upvotes: 0

Views: 150

Answers (1)

Elias
Elias

Reputation: 2632

Just some ideas:

Try removing Indexes

 DROP INDEX 'INDEXNAME' ON 'table_name'

Then try removing constraints if there are any

ALTER TABLE table_name
DROP FOREIGN KEY Foreign_Key_Name

and then try dropping it?

Upvotes: 1

Related Questions