Forum LAMS for Tech-Heads - General Forum: Re: A stupid, stupid mistake


 
Search: 

2: Re: A stupid, stupid mistake
In response to 1 03/04/08 04:37 PM
[ Reply | Forward ]
Hi Mat,

I think that you can fix this by doing some changes on the db directly. Login into the MySQL database and run this script.

insert into lams_user_organisation_role set user_organisation_role_id = 1, user_organisation_id = 1, role_id =1 ;

That should restate sysadmin rights to your sysadmin user.

Thanks,

Ernie

Posted by Ernie Ghiglione

3: Re: Re: A stupid, stupid mistake
In response to 2 03/05/08 07:42 PM
[ Reply | Forward ]
Thanks Ernie, I tried it, but...

I get this error:

Cannot add or update a child row: a foreign key constraint fails (`lams2/lams_user_organisation_role`, CONSTRAINT `FK_lams_user_organisation_role_3` FOREIGN KEY (`user_organisation_id`) REFERENCES `lams_user_organisation` (`user_organisation_id`) ON DELETE N)

Any ideas?

Matt.

Posted by Matthew Topp

4: Re: Re: Re: A stupid, stupid mistake
In response to 3 03/05/08 08:07 PM
[ Reply | Forward ]
You need to fulfill the constraint before running that script.  Do this first:

insert into lams_user_organisation (organisation_id, user_id) values (1,1);

then do:

select user_organisation_id from lams_user_organisation where organisation_id=1 and user_id=1;

you'll get a number back.  in the following script replace <the number> with this number.

insert into lams_user_organisation_role (user_organisation_id, role_id) values (<the number>, 1);

then restart lams.  if you run these 3 commands, don't run Ernie's one.  also, insert usual warning here about modifying data, make sure you have backups, etc.

Posted by Jun-Dir Liew

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum