how can i delete users that has no post using mysql?
I think they were all made to Spam the forum back when I still don't have registration security questions and some plugins.
whats the mysql command to use to delete users with no posts?
Try this:
DELETE FROM `mybb_users` where postnum=0
Make sure to do a db backup before you run this. The above query would delete all users having 0 posts.
it says
Quote:520 row(s) deleted. ( Query took 0.0697 sec )
yet it never really deleted some users.
actually its better to use user pruning settings from configuration settings of admin panel
users pruningdon't seemtowork too.
i tried once again the command
Quote:DELETE FROM mybb_users
where postnum=0
and it now returned
Quote:#1054 - Unknown column 'postsnum' in 'where clause'
yet no users has been deleted still
^ hmm., do not know why user pruning is not working for you ! anyway, if you do not see
that users are deleted then run Recount Statistics from Recount & Rebuild section ..
(2011-12-19, 03:10 PM)enhu Wrote: [ -> ]users pruningdon't seemtowork too.
i tried once again the command Quote:DELETE FROM mybb_users
where postnum=0
and it now returned
Quote:#1054 - Unknown column 'postsnum' in 'where clause'
yet no users has been deleted still
Its not postsnum, there is no such column, I said postnum.
(2011-12-19, 02:32 PM)enhu Wrote: [ -> ]it says Quote:520 row(s) deleted. ( Query took 0.0697 sec )
yet it never really deleted some users.
Nope, that should have deleted all users having 0 posts I believe.
Its better to do this with "Pruning".
ACP > Configurations > User pruning > and do the settings like this;
Enable user pruning? = On
Prune user by post count? = On
Post count to prune by = 0
Prune User Posts/Threads = Yes
save settings.
^This.
And anyway, if you already ran the query, try "Recount and re-build" suggested by ranjani.
Terrible idea to delete a user with single sql command. Users even with 0 posts can leave other data in the database.