LoginSignup
0
1

More than 5 years have passed since last update.

mysqlでsqlを外部ファイルから実行する

Last updated at Posted at 2017-09-04
mysql -u ユーザ -D スキーマ -pパスワード < sql_0904.txt

sql_0904.txtの中身

insert into test_table(test_clm, created)values('test1',CURRENT_TIMESTAMP);
insert into test_table(test_clm, created)values('test2',CURRENT_TIMESTAMP);
insert into test_table(test_clm, created)values('test3',CURRENT_TIMESTAMP);
insert into test_table(test_clm, created)values('test4',CURRENT_TIMESTAMP);
insert into test_table(test_clm, created)values('test5',CURRENT_TIMESTAMP);

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