1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

How To Create a Database in MySQL

By

Screenshot from phpMyAdmin

Screenshot from phpMyAdmin

Before you can interact with your MySQL database, you need to create it! We can show you two ways to do this: with phpMyAdmin, or with SQL code from the query window or a shell prompt. Don't worry it's not that hard.
Difficulty: Easy
Time Required: 2 mins

Here's How:

  1. If you have phpMyAdmin, you first need to login. In the right hand pane you are looking for "Create New Database". All you need to do is enter the database name, and wha-la, your done. Sometimes this feature is disabled. If this is the case, you need to contact your hosting company to create a new database.
  2. You can use SQL code though the SQL query window in phpMyAdmin, or from a command line. You can create a database by executing the following SQL code:
    create database DBname; 
    Be sure to replace DBname with the actual name you wanted your database to be called.

What You Need

  • Before you begin, be sure you know your MySQL username and password
Related Video
iMovie Slideshow
  1. About.com
  2. Technology
  3. PHP / MySQL
  4. Learn MySQL
  5. How To Create a New Database in MySQL

©2014 About.com. All rights reserved.