I have also encountered this. What I did was to alter the database schema so 
that deleting a user causes the relevant log entries to also be deleted.

something like this:

ALTER TABLE `log` ADD FOREIGN KEY (`userid`) REFERENCES `user` (`id`) ON DELETE 
CASCADE;
ALTER TABLE `querylog` ADD FOREIGN KEY (`userid`) REFERENCES `user` (`id`) ON 
DELETE CASCADE;

Then you should be able to simply remove a user from the database.

Aaron


On May 22, 2012, at 1:29 PM, James O'Dell wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I believe I've seen this before. It won't let you delete things
> that are referenced in the log/querylog (stored in the database).
> 
> Have you tried zeroing out the log, and then removing the account?
> 
> __Jim
> 
> On 5/22/2012 10:16 AM, Mike Haudenschild wrote:
>> Good afternoon,
>> 
>> During our beta testing, I created a number of generic local accounts
>> (using vcld --setup).  Now that we're moving into production, we're
>> using Shib and LDAP and I need to delete those local accounts.  When I
>> try manually removing the user from the vcl.user table, I get the
>> following error:
>> 
>> ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
>> constraint fails (`vcl/querylog`, CONSTRAINT `querylog_ibfk_1` FOREIGN
>> KEY (`userid`) REFERENCES `user` (`id`))
>> 
>> I'm hesitant to go poking about any further in the database.  Is there a
>> standard procedure for removing local users?  (Note: I'm on 2.2.1.)
>> 
>> Thanks,
>> Mike
>> 
>> --
>> *Mike Haudenschild*
>> Education Systems Manager
>> Longsight Group
>> (740) 599-5005 x809
>> m...@longsight.com <mailto:m...@longsight.com>
>> www.longsight.com <http://www.longsight.com>
>> 
> 
> 
> - -- 
> Jim O'Dell
> Network Analyst
> California State University Fullerton
> Email: jod...@fullerton.edu
> Phone: (657) 278-2256
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk+7zOUACgkQREVHAOnXPYTPggCgjf83JqEUgV96hdEZ8jRPM7JD
> kyAAmwUSA1zOKUMPDC3W92eoFsm4q4LN
> =DIEC
> -----END PGP SIGNATURE-----

Reply via email to