Reputation: 4332
I am fairly new to using mysql. I have an application that performs some basic querying. I am also trying to run a simple delete statement -
delete from mydb.mytable
This table is a simple 2 column table with not keys or triggers or anything defined. For some reason, the delete is not being performed. If I run the statement from MySql Workbench in the query window, it works fine. From the code, it does nothing. I am not seeing any error messages. I created a user with select, insert, update and delete rights to the schema. I am able to do the insert fine, but the delete does not seem to be working.
Is there a setting for mysql that I am missing that will not allow me to perform the delete? Thanks for any thoughts.
Upvotes: 1
Views: 295
Reputation: 37354
Fist of all, check if
As a side notice, if you want to delete all records, you should use truncate
instead of delete
Upvotes: 1
Reputation: 1
We would have to see some of your code to answer the question.
My guess is that you are not calling commit from your code. You can configure MySQL to auto-commit your queries, but this is usually not what you want.
Upvotes: 0
Reputation: 67695
Are you using transactions? My first guess is that your code might be issuing a BEGIN TRANSACTION without a COMMIT.
Upvotes: 0