Create a MySQL database

I generally only need to do this once for each project, which means I don’t do it often enough to remember. Log in to the MySQL server as root, then:

create database newdb;
grant all on newdb.* to 'newuser'@'localhost' identified by 'newuser';
set password for 'newuser'@'localhost' = password('newpass');

And you’re ready to go!
Replace newdb, newuser and newpass with whatever you like.

Share:
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Technorati
  • TwitThis

Leave a Reply