Title: Building a database from the command line (READ and VIEW)
Course: PHP/MySQL Course

Building a database from the command line (READ and VIEW)

Read about inserting on page 310 to 312.

1. play one of these videos on connecting to the cbis server using a SSH client:
- SSH Client for Mac or Linux Users
- SSH Client for Windows Users

Play the video about access mysql from putty:

- video on doing a mysql session to create a database

Important Notes about material in the video:
- use the command show databases; to list all databases
- to create a database on the cbis3 server you must start the database name with your account name and then a underscore, my account name is tstudent, so I created a database named tstudent_grocery_store with the following command:

create database tstudent_grocery_store;
- Before using any commands for a database, you need to tell mysql that you want to make the database your current database by issuing a command like:

use tstudent_grocery_store;

where you substitute your database name.
- Once you have a database you can display the tables in it with the command:

show tables;

to show the structure of a table use a command like:

desc tableName;

where yo put the name of the table you want.
- Two more commands that are not in the book are the ones for deleting a table or deleting a database:

drop database datbaseName;
drop table tableName;
- Remember to not insert id fields that have auto_increment set. (the book is wrong in it's example)