Howtos / Articles

Create a new database in MySQL

This howto will outline the steps to create a new blank MySQL database.

Run the MySQL client:

$ mysql -u root -p

You will be asked for a password. If you don’t have a password set, simply press enter when prompted.

Run the following command to create a new database:

CREATE DATABASE <database name>;

Replace <database name> with the name of the database you wish to create.

eg:

CREATE DATABASE websitedev;

Remember to set up user permissions on the newly created database. See ‘Grant a MySQL user access to a database‘ for more details.

Exit the MySQL client:

exit


Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>