2020年1月17日金曜日

mysqlのload data 時に「ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides」エラーが発生しました。

久々にlocalのDBにデータをloadしようと思ったら、以下のエラーがおきました。
mysql> load data local infile '/tmp/test.log' into table log FIELDS TERMINATED BY ',';
ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides

以下の2つ手順でエラーを解消することができました。
Step1、 my.cnfファイルに 行「loose-local-infile = 1」を追加
 ※ my.cnf変更後にmysqlの再起動が必要 自分の場合コマンド「mysql.server restart」を実行しました。

Step2、mysqlにログイン時に「--local-infile=1」を付ける
 例: mysql -uroot --local-infile=1 logdb;

2019年11月13日水曜日

2019年11月5日火曜日

linuxシステム変数を出力するコマンド

システム環境変数を出力する
$ set
または、
$ set | more
フィルターしたい場合は
$ set | grep 'USER' fdsfds
例えばZOOKEEPER_HOMEのパスを知りたい場合は、以下のコマンドを使う:
# set | grep 'ZOOCFGDIR'
ZOOCFGDIR=/conf