I am getting this error.
My client said there is no option to give me those privileges. It’s a very restricted cPanel or something.
So I need to find a way to empty the table, and also reset the incremental values, etc without having DROP command privilege. Any suggestions?
2
I am not here to talk security .. But if you simply wanted to “clear” the table.. You can use DELETE with a CONDITIONAL .. IE
DELETE
CONDITIONAL
DELETE FROM table_name WHERE id > 0;
The trouble with this is if you had IDs 1 – 300 in the database .. Without TRUNCATING the IDs will start from 301 and on —
ID
TRUNCATING
Without dropping and recreating the table, there is no way to reset the auto increment to start over again at 1, or at any value you’ve already used.
If you have DELETE privileges, you could empty the table by doing a DELETE FROM, but the auto increment won’t reset as long as the table exists.
Click here to cancel reply.
2
Answers
I am not here to talk security .. But if you simply wanted to “clear” the table.. You can use
DELETE
with aCONDITIONAL
.. IEThe trouble with this is if you had
ID
s 1 – 300 in the database .. WithoutTRUNCATING
theID
s will start from 301 and on —Without dropping and recreating the table, there is no way to reset the auto increment to start over again at 1, or at any value you’ve already used.
If you have DELETE privileges, you could empty the table by doing a DELETE FROM, but the auto increment won’t reset as long as the table exists.