SQL Statements - Create a database

December 20th, 2006 by Terry Pearson

As mentioned in earlier posts, SQL is an extremely important part of web development. Below is instruction on how to create a database in SQL. This is based on a Linux MySQL DBMS, but it should work (or be very similar) on other versions of SQL as well.

  1. Log in to MySQL by typing:
    • mysql -u username -p
  2. If you wish to see existing databases, type:
    • show databases;
  3. Now, we can create the new database. We will call the database “thisDatabase:”
    • create database thisDatabase;
  4. Then we need to assign permissions to a user. This can be a new or an existing user. We will use the user name, terry. The password will be set to password:
    • GRANT ALL ON thisDatabase.* TO terry@localhost IDENTIFIED BY “password”;

Congratulations, your database is set up. This is something that you will need to use if you are installing a content management system like Wordpress, Drupal, or Xoops. You can read more about creating a database by clicking here.


0 Responses to “SQL Statements - Create a database”

Feed for this Entry Trackback Address
  1. No Comments

Leave a Reply

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