Set root password:
UPDATE mysql.user SET Password=PASSWORD('mysecret') WHERE User='root';
FLUSH PRIVILEGES;
Remove anonymous users:
DELETE FROM mysql.user WHERE User='';
Disallow root login remotely:
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
Remove test database and access to it:
DROP DATABASE test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'
Reload privilege tables:
FLUSH PRIVILEGES;