I have this error at the top of my Moodle login page and no users can login.

Whenever I try to create a user account it says 'Could not add your record to the database.'

I have looked at the mdl-user table and all the records appear to be there. No users can login

I have tried the table repair but that still did not fix it.

Any help is appreciated