Recently I was performing one very simple MySQL query. But I am not getting success for that query. So after few mins of research I am found the solution for that.
Actually my query was just like below:
Isn’t it so simple? yes it is. But it was not working. Once I have started to debug the process I found that MySQL is throwing the below error:
“You are using safe update mode and you tried to update a table without a WHERE clause that uses a KEY column.”
MySQL will refuse to run the UPDATE or DELETE query if executed without the WHERE clause or LIMIT clause. MySQL will also refuse the query which have WHERE clause but there is no condition with the KEY column.
So below query will also be refused if safe mode is enabled:
There is a simple way to disable the MySQL Safe Mode. We can disable it with simple query.
Have a look at below query:
Note: MySQL will also refuse the query which have WHERE clause but there is no condition with the KEY column.
Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.
View all posts by: Avinash