I can never remember how to create a new MySQL user

Anyway, here’s the mother-lovin’ SQL all in one place:

create database db_name;
grant all on db_name.* to 'user_name'@'localhost' identified by 'password';
flush privileges;

For simple, personal projects, db_name = user_name = password, just to make life a little easier.

Carry on.

Feel free to if you found this useful.

Care to Comment?


Email (optional)

Blog (optional)