Database

There are a few quirks with MySQL especially when you’re doing simple things. However, there comes a time when things go awry.

Here’s an error I encountered recently:

BLOB/TEXT column '' can't have a default value: CREATE TABLE from mysql

Now, who would have known that you can have a default blank value in a blob or text type column?

Anyway, here’s a simple fix for it:

  • Find your MySQL config file
  • Comment out the following in it:
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  • Restart MySQL

After restarting, you won’t encounter this problem anymore!