DBA Sensation

March 11, 2009

MySQL disable safe update mode

Filed under: [MySQL] — Tags: , , — zhefeng @ 1:36 pm

when you update a table and in where clause the column name is not the primary key, you will get error said:

You are using safe update mode and you tried to update a table without…etc.”

It should be noted that even simple applications of UPDATE can conflict with the ‘safe mode’ setting of the mysql daemon. Many server admins default the MySQL daemon to ‘safe mode’.

If UPDATE gives an error like this:

“You are using safe update mode and you tried to update a table without…etc.”

…then it may be that your .cnf file must be edited to disable safemode. This worked for me. In order for the change in the .cnf file to take effect, you must have permission to restart mysqld in the server OS environment. There is a page in the online documentation that explains safe mode entitled ‘safe Server Startup Script’.

About these ads

9 Comments »

  1. SET SQL_SAFE_UPDATES=0;

    Comment by Aaron — October 1, 2010 @ 5:11 pm

    • it works thanks!!!!

      Comment by ricky — November 22, 2011 @ 9:30 am

  2. Reallly Great…..

    Thanks a lott :)

    Comment by Sachin Lande — December 9, 2010 @ 6:30 am

  3. thank u so much!!! I was really desperated! U savd me!!! =D

    Comment by CRAYOLA — April 9, 2011 @ 8:44 am

  4. Arnab
    It’s really very use full,thank’s

    Comment by arnab — September 20, 2012 @ 4:35 am

  5. Use this to enable safe updates after update:

    SET SQL_SAFE_UPDATES=0;
    UPDATE FROM table SET ‘field’=’value';
    SET SQL_SAFE_UPDATES=1;

    Comment by Hankyago — February 14, 2013 @ 4:21 am

  6. I am commenting to let you know of the extraordinary encounter my cousin’s child went through reading yuor web blog. She came to find too many details, with the inclusion of how it is like to possess an awesome helping mindset to let folks completely know just exactly selected grueling subject matter. You undoubtedly exceeded readers’ expected results.

    Many thanks for supplying these productive, healthy, educational and
    in addition fun tips about that topic to Lizeth.

    Comment by webkatalog eintragungen — June 11, 2013 @ 8:40 pm

  7. I enjoy you because of your whole work on this website.
    Kim really loves making time for investigations and
    it’s really obvious why. Most of us know all concerning the lively manner you give precious secrets by means of the web site and in addition foster response from visitors on the subject matter plus my princess has always been discovering a great deal. Take advantage of the rest of the new year. You’re doing a really good job.

    Comment by Together Mode — June 23, 2013 @ 7:11 am

  8. My spouse and i ended up being quite comfortable when Chris could
    carry out his preliminary research out of the ideas he received
    out of the web site. It is now and again perplexing to just continually
    be giving out guidance which usually other people may have been
    selling. And we all grasp we have got you to be
    grateful to for that. The entire explanations you have made, the simple website
    navigation, the relationships you will make it easier to create – it’s got mostly powerful, and it’s really helping our son in addition to our family feel that that concept is amusing, and that’s exceptionally important. Thank you for everything!

    Comment by Gartengestaltung — July 12, 2013 @ 2:39 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: