Initial setup on Ubuntu
mysql -u root
> alter user 'root'@'localhost' identified by 'PurpleTurnip';

Create user and grant permissions

create user 'turnip'@'%' identified by 'turnip';
create database turnip;
grant all on turnip.* to 'turnip'@'%';
use turnip;
create table hello( id int(6) unsigned auto_increment primary key, firstname varchar(30) not null, lastname varchar(30) not null);
create database cabbage;
create table cabbage.hello ( id int(6) unsigned auto_increment primary key, firstname varchar(30) not null, lastname varchar(30) not null);
create table cabbage.world ( id int(6) unsigned auto_increment primary key, firstname varchar(30) not null, lastname varchar(30) not null);
grant all on cabbage.world to 'turnip'@'%';
Now
insert into hello ( firstname, lastname ) values ( "boink", "snarf" );
gives access denied, whereas
insert into world ( firstname, lastname ) values ( "boink", "snarf" );
succeeds. So users can be given fine grained permissions as to what tables they can access and what they can do with them.

As admin

revoke all on cabbage.world from 'turnip'@'%';
now as user turnip
select * from cabbage.world
gives access denied. But then
grant select on cabbage.world to 'turnip'@'%';
and now the select command works.

Misc stuff

show databases;
drop database cabbage;
SELECT user FROM mysql.user;
drop user turnip;
sensibly
drop user root;
does not work.

Root account stuff

On Ubuntu you connect to the root account via

sudo mysql
With Xampp you use
mysql -h 127.0.0.1 -u root -pPASSWORD
(or omit the PASSWORD after -p and it will prompt to avoid it turning up in your shell history) To reset the Xampp root password:
mysqladmin.exe -h 127.0.0.1 -u root password WhateverPassword
The -h 127.0.0.1 is necessary if you are using Cygwin and its mysql and mysqladmin to access the server. (I couldn't survive on Windows without Cygwin. 😉)