I am trying to delete all records from a table. My query is:
delete from tableName.
But it reports the following error:
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor -> Query Editor and reconnect."
How do I resolve this?
We can use DELETE statement along with a WHERE clause, which identifies those multiple rows, to delete multiple rows from MySQL table.
The Delete query in MySQL can delete more than one row from a table in a single query. This proves to be advantages when removing large numbers of rows from a database table. Once a Delete row in MySQL row has been deleted, it cannot be recovered.
truncate tableName
That is what you are looking for.
Truncate will delete all records in the table, emptying it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With