> my-default.ini datadir variable (my.ini doesn't exist in my installation of mysql 5.6)
Create my.ini from my-default.ini -- the latter is just a suggestion.
Some further tips:
http://mysql.rjweb.org/doc.php/memory
> How can I move the database back and forth between two computers?
How about having the entire mysql directory tree on a USB stick or transportable hard drive? And have permanent my.ini files on each machine; they would point to the stick. (There may be an issue of mounting the stick when you startup; I don't know.)
The two my.ini files would have the same name (the default name that the installation wants), but would have a few things different, perhaps including
innodb_buffer_pool_size if you have different amounts of RAM. They would, as you discovered need different values for "basedir".
When running, do SHOW VARIABLES LIKE '%dir%' to see if the settings make sense.