2020年5月19日火曜日

MySQL テーブル追記(for Shell)

参照先:
https://qiita.com/CyberMergina/items/f889519e6be19c46f5f4


#!/bin/bash

HOSTNAME="127.0.0.1"
PORT="3306"
USERNAME="root"
PASSWORD="pass"

MYSQL_SCHEMA="soe_admin"
CMD_MYSQL="mysql -h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} --show-warnings $MYSQL_SCHEMA"

#QUERY="SELECT client_cd FROM clients"
VALUE=`echo ${QUERY} | ${CMD_MYSQL}`


${CMD_MYSQL} <<EOF
INSERT INTO clients (client_cd, resq_client_cd, client_dbname, db_type, description, dropped_flag, created_datetime, modified_datetime, deleted_flag, dbhost) VALUES ("test1", " ", "soe_test", " ", " ", " ", " ", " ", " ", "192.168.1.1")
EOF

0 件のコメント:

コメントを投稿

php log(ECS ログ出力)

# PHPエラーログの設定 ENV PHP_INI_DIR /usr/local/etc/php RUN { \ echo 'log_errors = On' ; \ echo 'error_log = /proc/self/...