What's the practice to generate long user id like those on Facebook?
Why not just set the auto_increment to 4000000 and let it count from there?

ALTER TABLE `table` AUTO_INCREMENT=4000000;


Also, make sure your id column can fit large numbers (bigint or similar)