FrontPage > DataBase > MySQL > MySQLメモ

MySQLメモ

ランゲージ確認 (character_set)

mysql> show variables like "char%";

ランゲージ変更

utf8mysql> SET NAMES utf8;
SJISmysql> SET NAMES sjis;
EUCmysql> SET NAMES ujis;

タブ区切り、CSV(カンマ区切り)ファイルのインポート

ファイルのランゲージ(S-JIS、EUC、UTF-8)とmysqlのランゲージを一致させる必要あり。

タブ区切りファイルのインポート

mysql> load data local infile '[ファイル名]' into table [テーブル名];

CSV(カンマ区切り)ファイルのインポート

mysql> load data local infile '[ファイル名]' into table [テーブル名] fields terminated by ',';

結果

Query OK, 999 rows affected, 9999 warnings (0.09 sec)
Records: 999  Deleted: 0  Skipped: 0  Warnings: 9999

「ワーニング(Warnings)」は、「show」コマンドで確認

mysql> show warnings;

メモ


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-04-28 (水) 09:45:26