Это старая версия документа!
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'new_password'; GRANT ALL ON my_db.* TO 'new_user'@'localhost'; FLUSH PRIVILEGES;
SELECT * FROM `auth_user` WHERE not EXISTS (SELECT * FROM userprofile_userprofile WHERE userprofile_userprofile.user_id=auth_user.id );
SELECT * FROM `auth_user` WHERE id NOT IN (SELECT user_id FROM userprofile_userprofile) ORDER BY `id` ASC
DELETE FROM `auth_user` WHERE not EXISTS (SELECT * FROM userprofile_userprofile WHERE userprofile_userprofile.user_id=auth_user.id );