mysql -uroot -p
: login with password in mysql
CREATE DATABASE databaseName;
: create database
SHOW DATABASES;
: show all databases
USE databaseName
: select database and use it
CREATE TABLE tableName (key dataType NULL or NOT NULL AUTO_INCREMENT or empty ... PRIMARY KEY(id)
: create table type
SELECT whatYouWantToShowKey&Value FROM dataBaseName
: show your data in database
+----+--------+---------------------+--------------+
| id | title | created | author |
+----+--------+---------------------+--------------+
| 1 | MYSQL | 2021-07-14 00:12:14 | YOONYOUNGJOO |
| 2 | ORACLE | 2021-07-14 00:14:25 | YOONYOUNGJOO |
+----+--------+---------------------+--------------+
DESC schemaName
: describe schema
+-------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | title | varchar(100) | NO | | NULL | | | description | text | YES | | NULL | | | created | datetime | YES | | NULL | | | author | varchar(30) | YES | | NULL | | | profile | varchar(100) | YES | | NULL | | +-------------+--------------+------+-----+---------+----------------+