アットウィキロゴ

mysql 基本

  • インストール
  • ユーザー作成
grant all privileges on *.* to exchange@"%" identified by 'exchange' with grant option
grant all privileges on *.* to exchange@localhost identified by 'exchange' with grant option
flush privileges
  • データベース作成
create database exchange
  • データベース削除
drop database exchange
  • テーブル作成
create table rate (
date date not null,
end varchar(6) not null,
begin varchar(6) not null,
high varchar(6) not null,
low varchar(6) not null,
primary key (date)
)
create table ma (
date date not null,
end varchar(6) not null,
begin varchar(6) not null,
high varchar(6) not null,
low varchar(6) not null,
sma varchar(6) not null,
rma varchar(6) not null,
wma varchar(6) not null,
ema varchar(6) not null,
primary key (date)
)

  • テーブル削除
drop table rate
  • インポート
load data infile "c:/data.csv" into table rate fields terminated by ',' enclosed by '"'
最終更新:2007年08月19日 17:50