How to create a database in MYSQL ?



To create a new database:
 CREATE DATABASE databasename ;

Prepare to edit the table
USE databasename ;

Create "tables" - these are the structure of your database. You can create multiple tables within the database.
  • CREATE TABLE tablename (
fieldname1 fieldtype1 optional-parameters1,
fieldname2 fieldtype2 optional-parameters2,
.... ,
PRIMARY KEY( fieldname ) );

Check the table is correct:  
SHOW COLUMNS FROM tablename

No comments:

Post a Comment