LoginSignup
1
1

More than 5 years have passed since last update.

MySQL

Last updated at Posted at 2016-07-18

接続

mysql -u root -p


DB選択

use DB名


ユーザ作成

create user ユーザ名 identified by'パスワード'

DB作成

create database db名

テーブル作成

create table テーブル名(カラム名 ,カラム名 ,カラム名 ..)

テーブル一覧表示

show tables from db名

テーブル削除

drop table テーブル名

レコード挿入

insert into テーブル名 (カラム名)values()

レコードの値更新

update テーブル名 set カラム名 = 変更する値 where 変えるid =

カラム追加

alter table テーブル名 add カラム名 型情報

カラム名変更

alter table テーブル名 change 古いカラム名新しいカラム名

カラム削除

alter table テーブル名 drop カラム名

テーブルを日本語使用可能にする

alter table テーブル名 character set utf8

カラムを日本語使用可能にする

alter table テーブル名 midify カラム名 character set utf8

テーブル削除

delete from table名 where 削除したいid =

1
1
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
1
1