Home > Blogging security, Data Security > SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO

SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO

October 6th, 2007

SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”; happens when different version of mysql is being used. When you are transfering from one server to another you should keep in mind the versions of database use in a new environment especially the mysql.

However i was also victimized of above bug which i fix after a long search and ideas.

The fix is as follow. simply delete the following lines from your database and you are done

SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;
ENGINE=MyISAM DEFAULT CHARSET=latin1;

In short open your database file in note pad and find the above two lines mentioned and keep on with your new location.

If you like it then dont forget to give thanks comments.



Computer security Blogging security, Data Security , , , , , ,

  1. Ximo
    January 23rd, 2008 at 08:26 | #1

    Beware that if you have a row with a primary/unique key of 0, removing NO_AUTO_VALUE_ON_ZERO will make SQL interpret it as NULL and thus auto_increment its value. You will then have to manually set the column that has been changed during the import back to its original value of 0, or your data will not be valid.

  2. Roger
    April 18th, 2008 at 14:31 | #2

    Thanks but it didn’t work. I tries saving my database as mysql4 from 5.

    The first line was easy to remove but the second didn’t exist as such..
    BTW you have the Greek flag by the English language option :)

  1. No trackbacks yet.