0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ターミナルでSQL文を使ってDB操作

Posted at

MySQLに接続

mysql -u root

データベースの確認

SHOW DATABASE;

###データベース作成

CREATE DATABASE データベース名;

使用するデータベースの選択

USE データベース名;

テーブル作成

CREATE TABLE テーブル名(カラム名 データ型);#カンマ区切りで複数カラム作成可。

カラムを見る

SHOW columns FROM カラム名;

カラムの追加

ALTER TABLE テーブル名 (カラム名 データ型);#カンマ区切りで複数カラム作成可。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?