2020-09-01から1ヶ月間の記事一覧

updateでのselect権限必要性

DB

MySQL (8.0.21) -- テストテーブル作成drop table tab1;create table tab1(col1 int);alter table tab1 add constraint tab1pk primary key(col1); insert into tab1 values(1);select * from tab1; -- テストユーザ作成drop user 'user1'@'%';create user '…

パスワードポリシー

DB

MySQL (8.0.21)https://tokyo-engineer.com/mysql8-password-root/#ihttps://dev.mysql.com/doc/refman/8.0/en/validate-password-options-variables.html ※デフォルトで有効 SHOW VARIABLES LIKE 'validate_password.%'; +--------------------------------…

アーカイブログサイズ調査

DB

MySQL (8.0.21) -- テストテーブル作成drop table tab1;drop table tab2; create table tab1(col1 numeric(10,0),col2 numeric(10,0),col3 numeric(10,0),col4 numeric(10,0),col5 numeric(10,0),col6 varchar(30),col7 varchar(30),col8 varchar(30),col9 v…

月末月初テスト用シェル

systemctl stop chronydsystemctl status chronyd vim change_time.sh #!/bin/bash MONTH01=20210301INTERVAL=7200 while true;do MONTH01=`date --date "${MONTH01} 1 month" '+%Y%m01'` SET_TIME=`date --date "${MONTH01} -1 day" '+%Y/%m/%d 23:00:00'` …

{Aurora}カスタムエンドポイントの使用

AWS

カスタムエンドポイントの作成 aws rds create-db-cluster-endpoint \--db-cluster-identifier mycluster01 \--db-cluster-endpoint-identifier myep01 \--endpoint-type ANY \--static-members mydb01 mydb02 \--tags Key=Name,Value=myep01 カスタムエンド…

AWS CLI(RDS)

AWS

サブネットグループの作成aws rds create-db-subnet-group \--db-subnet-group-name mysubnetgroup \--db-subnet-group-description mysubnetgroup \--subnet-ids '["subnet-12345678901234567","subnet-12345678901234567"]' サブネットグループの一覧aws r…

AWS CLI(Cost Explorer)

AWS

https://qiita.com/shinsaka/items/c368c403935549b4401bhttps://dev.classmethod.jp/articles/road-to-jq-master-apprentice/ ※1リクエスト当たり0.01ドル課金されるコスト合計aws ce get-cost-and-usage \--time-period Start=2020-08-01,End=2020-09-01 \…

アセンブラでHello World

OS

Ubuntu (20)http://hironemu.hatenablog.com/entry/20090210/1234279094 apt install nasmnasm --version vim hello.asm section .textglobal _start msg db 'Hello world!', 0x0Amsglen equ $ - msg _start: mov ecx, msg mov edx, msglen mov eax, 4 mov e…

CでHello World

OS

Ubuntu (20)http://yamada.daiji.ro/blog/?p=1044 apt install build-essential gcc --version vim hello.c #include <stdio.h> int main(void){ printf("Hello World!\n"); return 0;} gcc -o hello hello.c./hello --vim web.c #include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h></sys/socket.h></sys/types.h></string.h></stdio.h></stdio.h>…

PHPでHello World

OS

Ubuntu (20) apt install php7.4-cliphp -v vim hello.php php hello.php --vim web.php php -S 192.168.137.167:8080 web.php Debian (10) apt install php7.3-cliphp -v vim hello.php php hello.php --vim web.php

ロック行のスキップ

DB

MySQL (8.0.21) drop table tab1;create table tab1(col1 int,col2 int,col3 varchar(10) ); create index ind11 on tab1(col1); insert into tab1 values(1,100,'off');insert into tab1 values(2,100,'off');insert into tab1 values(3,100,'off');select …

オーナの変更

DB

MySQL (8.0.21) オーナの概念なし Oracle (12cR1) オーナの概念なし PostgreSQL (9.4) オーナーの概念あり -- 所有権を指定してデータベース作成create database db10 owner = user10; -- 所有権を指定してスキーマ作成create schema schema10 authorization…

タイムゾーン設定

DB

MySQL (8.0.21)https://qiita.com/tailak/items/63dce2dd7dfe049b038ehttps://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html vim /etc/my.cnfdefault-time-zone='+00:00' select @@time_zone;show variables like '%time_zone%'; select now(); ※…

シーケンス現在値確認

DB

MySQL (8.0.21) drop table tab1; create table tab1 (col1 int auto_increment,primary key (col1)); insert into tab1 values();select * from tab1; analyze table tab1; select auto_increment from information_schema.tables where table_schema = 'te…