Creating a Database and Tables
Procedure
- Log in to the MySQL database.
1mysql -u<User name> -p<Password>
- Create a database.
create database <Database>;
- Create a table in the database.
use <Database>; create table <Table name> (<Column name> <Data type>);
Example
- Log in to the MySQL database.
1mysql -uroot -p
- Create a database.
create database db1;
- Create a table in the database.
use db1; create table tb1(username varchar(20) not null);
Parent topic: Backing Up the Database