I always forget the syntax to create a new mysql user, so I decided to write it in here for later reference. I am doing this from a mysql terminal, so first we need to login:

1
2
mysql -uroot -p
mysql>

And then we can:

1
2
CREATE USER 'username'@'domain' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.table TO 'username'@'domain'

When issuing the GRANT command you can use wildcards like this:

1
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%'

And that is pretty much all there is to it.

[ mysql  ]