How to delete users from moodle?

There is a discussion about mass delete user account at
http://moodle.org/mod/forum/discuss.php?d=72880
But, it’s easier for me to just delete unwanted users from the database. My dbms is postgresql-8.3.

So, here are the steps:

$ psql -u mymoodlename -d mymoodledb -h localhost
psql> delete from mdl_user where email~’i-pod.info’;
psql> \q

Done!!!

Ref: http://www.postgresql.org/docs/8.3/static/functions-matching.html

NOTE: My site attracts anonymous user like ‘xzyfaxzffzxf@i-pod.info’ a lot. :)
PS: I don’t know if this gonna break any relation in the db or not. If you know, please comment me.

1 Comment

  1. misui said,

    June 8, 2008 at 5:31 pm

    sorry for my english, i’ll try to check relation and report after present javajive challenge.

    ps.could i type in thai?


Post a Comment