In MySQL command line client after logging in as root, I typed:
connect mydb; grant all privileges on mydb.* to \'admin\'@\'localhost\' identifi
Try following
put.execute("grant all privileges on mydb.* to 'john'@'localhost' identified by 'pass'");
And also make sure you have ExtendedAnsiSQL flag to 1.