Welcome Guest, Not a member yet? Register   Sign In
DX Auth DB Error (New Install)
#1

[eluser]Unknown[/eluser]
I just set up DX Auth. I am a CI newbie, so sorry if this is dumb...i get the following erro and get get past it. I have set up the tables in a new "dx" database (MySQL).

Error Number: 1364

Field 'user_data' doesn't have a default value

INSERT INTO `ci_sessions` (`session_id`, `ip_address`, `user_agent`, `last_activity`) VALUES ('db151aeadf462f09f669002c0f390895', '127.0.0.1', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv', 1233093923)

What am I doing wrong?
#2

[eluser]trice22[/eluser]
If you're using the SQL statement from the user guide in order to create the table ci_sessions, the field "user_data" has to be per definition "NOT NULL".
In your case you're not passing on any user data and a default value has not been defined for the this row either, which most likely causes this error.
You could try to set the default value in your database table for "user_data" to 0.

Since this sounds like an upgrade issue from 1.6.3 to 1.7 I'd recommend to search the thread concerning DX Auth here in the forum closely. I'm sure that you're not the only one who had this problem and there might be a better fix existing.

Good Luck,
—trice
#3

[eluser]Unknown[/eluser]
Hi there,

Thanks for the advice. The thing is I am using the DX solution "out of the box" and have not modified the SQL at all. MySQL won't allow me to set a default value on a TEXT/BLOB column, so it seems I am stuck. Has anyone else seen this?
#4

[eluser]Unknown[/eluser]
I ran into the same problem that you mentioned. I modified the definition of the ci_session table so that it doesn't require the user_data field to be not null, and it worked!

Here is the sql statement that I used to create the ci_sessions table:

CREATE TABLE IF NOT EXISTS `ci_sessions` (
`session_id` varchar(40) collate utf8_bin NOT NULL default '0',
`ip_address` varchar(16) collate utf8_bin NOT NULL default '0',
`user_agent` varchar(150) collate utf8_bin NOT NULL,
`last_activity` int(10) unsigned NOT NULL default '0',
`user_data` text collate utf8_bin,
PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

HTH.




Theme © iAndrew 2016 - Forum software by © MyBB