MySQLコマンド (DOSプロンプト) 入力編

  • ユーザー名 でログインする。
    > -u ユーザー名 -p
  • データベースを作成する。
    > create database DB名;
  • データベースを確認する。
    > show databases;
  • 普段操作するユーザーを作成する。
    > grant select,insert,delete,update,create,drop,file,alter,index on *.* to ユーザー名 identified by 'パスワード'; > flush privileges;
  • 使用するデータベースを選択する。
    > use DB名;
  • テーブルを作成する。
    > create table テーブル名(
    -> id int(10),
    -> title text,
    -> フィールド名 フィールドのタイプ,
    -> );
  • データの挿入。
    > insert into テーブル名
    -> (id,title,field1,field2,)
    -> VALUES(’15′,’うどん’,'要素1′,’要素2′);
  • ファイルのインポート
    > load data infile 'C:/CVSデータなど.txt'
    -> into table テーブル名;

No Responses to “MySQLコマンド (DOSプロンプト) 入力編” »

RSS feed for comments on this post. and TrackBack URI

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>