Bug #16807
closedcreate admin user fails because of bad be_users table definition
0%
Description
When installing from scratch typo3 4.0.4 with mysql 5, the creation of the admin user fails silently (and is being reported as sucessful : why not display a mysql_error() when the request fails ?). After enabling mysql logging, I was able to capture the create admin query which is in my case :
INSERT INTO be_users
(
username,
password,
admin,
uc,
fileoper_perms,
tstamp,
crdate
) VALUES (
'hyptique',
'5f756609613af47ba8ef6808695f77c7',
'1',
'',
'7',
'1166784931',
'1166784931'
)
I typed into phpMyadmin and the request fails with the following error :
#14916 - Field 'usergroup' doesn't have a default value
Now if you look at the table definition created from the install tool, you will notice the field 'usergroup' (which is not present into the create admin query thus falls back to default value) is specified as NOT NULL and doesn't have a default value.
The same goes for many other fields in the be_users table.
(issue imported from #M4691)
Updated by Alban Cousinie almost 18 years ago
the query fails on the following fields :
usergroup
userMods
allowed_languages
TSconfig
usergroup_cached_list
Changing their specification from 'NOT NULL' TO 'NULL' into Phpmyadmin allows the create admin query to complete successfully.
Proposed fix is to alter the be_users table definition from t3lib\stddb\tables.sql and remove the 'NOT NULL' statement of any field not specifying a DEFAULT value.
Updated by Alban Cousinie almost 18 years ago
This problem is likely to affect other areas of typo3 as well since it can be found in many table definitions. It probably does not occur on all mysql versions, otherwise it would have been reported often.
Updated by Alban Cousinie almost 18 years ago
This issue is a duplicate of 0002634 and 0004003. Strangely it has not been fixed so far
Updated by Alban Cousinie almost 18 years ago
I have just fixed the issue. See issue 0004693 for patch.
Replace t3lib/stddb/tables.sql with the one supplied in issue 0004693, delete your typo3 database and recreate it. Things should now be fine.