Posted 2004/10/08 4:37 pm in Languages
- ユーザー名 でログインする。
> -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 テーブル名;