Luqman Marzuki

Luqman Marzuki writes about anything



Symphony Install Error DatabaseException Fix

Symphony Install Error DatabaseException Fix

Fix for PHP based CMS Symphony installation error, Fatal error: Uncaught exception 'DatabaseException' with message 'MySQL Error (1364): Field 'role_id' doesn't have a default value in query...

I got this error message after submitting the install form at the first page of Symphony installation:

Fatal error: Uncaught exception 'DatabaseException' with message 'MySQL Error (1364): Field 'role_id' doesn't have a default value in query "INSERT INTO `sym_authors` ( `id` , `username` , `password` , `first_name` , `last_name` , `email` , `last_seen` , `user_type` , `primary` , `default_section` , `auth_token_active` ) VALUES ( 1, 'user', MD5('password'), 'fname', 'lname', [email protected]', NULL , 'developer', 'yes', '6', 'no' );"' in G:\localhost\symerror\symphony\lib\toolkit\class.mysql.php:390 Stack trace: #0 G:\localhost\symerror\symphony\lib\toolkit\class.mysql.php(275): MySQL->__error() #1 G:\localhost\symerror\symphony\lib\toolkit\include.install.php(600): MySQL->query('INSERT INTO `t...') #2 [internal function]: Action::install(Object(Page), Array) #3 G:\localhost\symerror\symphony\lib\toolkit\include.install.php(1329): call_user in G:\localhost\symerror\symphony\lib\toolkit\class.mysql.php on line 390

If you got the same error message, then read on. Well, this fix is available on the internet but I had to find it after digging through forums and etc. I simply summarized it here so it would hopefully came up first if someone google it with the error message.

Ok, for the fix. It's fairly simple, there are two different ways you could fix it:

  1. Delete line 16 (`role_id` int(11) NOT NULL,) from install.sql file at the root directory.
  2. Or, download this new install.sql file and replace old install.sql file in the root directory with it.

Basically, the role_id column shouldn't be there. That's it.