Darius
Darius

Reputation: 1664

MySQL upgrade 5.5 to 5.6 created issue

I guess before, I was setting up my databases incorrectly by saying the column is not null, and there is no default value. ( I THINK, never paid attention ).

Now after updating to mysql 5.6, a lot of my columns say it is not null and it doesn't have a default value, and when I try to insert something like

values 1 2 3 (but no 4) into column 1 2 3

It fails and gives me an error because column 4 isn't set to null nor does it have a default value. Is there a setting in mysql to bypass this?

I migrated from 5.5 to 5.6

On cent os 6 , php 5.4

Just confused why the database worked before, and not anymore, all I did was export the database and did an import again.

Upvotes: 1

Views: 978

Answers (2)

Jithin U. Ahmed
Jithin U. Ahmed

Reputation: 1801

CTRL + ALT + T (terminal)

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo /etc/init.d/apache2 reload
sudo apt-get install phpMySql

Upvotes: 0

Darius
Darius

Reputation: 1664

Found the answer: http://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html

As of MySQL 5.6.13, the server applies the proper sql_mode checks to generate a warning or error at insert or update time.

A resulting incompatibility for replication if you use statement-based logging (binlog_format=STATEMENT) is that if a slave is upgraded, a nonupgraded master will execute the preceding example without error, whereas the INSERT will fail on the slave and replication will stop.

To deal with this, stop all new statements on the master and wait until the slaves catch up. Then upgrade the slaves followed by the master. Alternatively, if you cannot stop new statements, temporarily change to row-based logging on the master (binlog_format=ROW) and wait until all slaves have processed all binary logs produced up to the point of this change. Then upgrade the slaves followed by the master and change the master back to statement-based logging.


After further investigating, turning off mysql strict mode worked in my.cnf file.

Upvotes: 1

Related Questions