Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, June 18, 2007

MySQL error: Field doesn't have a default value

When inserting a new record with varchar or text field that is required and has no default value. This error will display for example:

error : Field 'description' doesn't have a default value

The possible reason is that sql-mode in my.ini is set to STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION.

Change the value to
sql-mode = ""

Update 2011/4/25:
Add Default value "" if possible to avoid changing mysql setting.

Tuesday, May 02, 2006

MySQL: Creating views and functions

Make sure thet the database user has SUPER Privilege, CREATE VIEWS and CREATE ROUTINE. In SQL Query type the following:

mysql> SET GLOBAL log_bin_trust_routine_creators = 1;

* Using MySQL 5.0.18