Sometimes we have to migrate some tables from one host to another. And sometimes we want to migrate users as well. This is how I managed to do this..
First let's read out all users
mysql --batch --skip-column-names -e "SELECT user, host FROM user" mysql