Currently, mysql_install_db provides default access to the test database by inserting some rows into the mysql.db table for the ''@'%' user account, but it does not insert any rows into the mysql.user table for that user account.
These rows are currently inserted by the scripts/mysql_test_db.sql script:
This method has some negative consequences. See MDEV-13486 for more information.
If we implement GRANT ... TO PUBLIC, then we should change mysql_install_db, so that mysql_install_db uses that instead.