1. Home
  2. Computing & Technology
  3. PHP / MySQL

MySQL Tutorial: Create SQL Tables

By , About.com Guide

4 of 4

Using Command Lines

If you prefer you can also run commands from a command line to create a table. A lot of web hosts don't give you shell access to the server anymore, or allow remote access to the MySQL servers. If you want to do it this way you may have to install MySQL locally, or try this nifty web interface. First you will need to login to your MySQL database. If you are unsure how try using this line: mysql -u Username -p Password DbName Then you can run the command:

CREATE TABLE people (name VARCHAR(30), age INTEGER, height FLOAT, date DATETIME);

To view what you have just created try typing in:

describe people;

No matter which method you chose to use, you should now have a table setup and ready for us to enter data into.

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Learn MySQL
  5. Shell Command - SQL Shell Commands - SQL Commands

©2009 About.com, a part of The New York Times Company.

All rights reserved.