UPDATE args SET id =(SELECT @a:= @a + 1 from (SELECT @a:= 0) s)
ORDER BY `id`
mysql --host=db_host --port=db_port --user=db_user --password=db_password --database=db_name --execute='sql here'
select `id` from `table` where (SELECT @s:= @s + `size` from (SELECT @s:= 0) s) < 1000000 order by `id` desc ;
connection.query('INSERT INTO users SET ?', {email: 'email@email'})