Mysql - CRUD
Login
$mysql -u root -p
>use database;
Exit
control + D
View
mysql> show tables;
+----------------+
| Tables_in_todo |
+----------------+
| TODO |
+----------------+
1 row in set (0.00 sec)
mysql> describe TODO;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| name | varchar(20) | YES | | NULL | |
| task | varchar(1000) | YES | | NULL | |
+-------+---------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
mysql> select * from TODO;
+------+---------------------+
| name | task |
+------+---------------------+
| eve | being a golang dev. |
| eve | being a golang dev. |
| eve | being a golang dev. |
| eve | being a golang dev. |
| eve | being a golang dev. |
+------+---------------------+
5 rows in set (0.00 sec)
C - create database or table
CREATE DATABASE dbName;
CREATE TABLE tableName;
Comments
Post a Comment