# Create MySQL tables:
CREATE TABLE pwtool.mypasswd (
	password VARCHAR(256) NULL,
	`code` varchar(64) NOT NULL,
	retrieved_ip varchar(39) NULL,
	retireved_time TIMESTAMP NULL,
	id BIGINT UNSIGNED auto_increment NOT NULL,
	CONSTRAINT mypasswd_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_bin;
CREATE INDEX mypasswd_id_IDX USING BTREE ON pwtool.mypasswd (id);


# create user:
CREATE USER 'pwtool'@'%';
ALTER USER 'pwtool'@'%'
IDENTIFIED BY 'XXX' ;
GRANT Insert ON pwtool.mypasswd TO 'pwtool'@'%';
GRANT Select ON pwtool.mypasswd TO 'pwtool'@'%';
GRANT Update ON pwtool.mypasswd TO 'pwtool'@'%';
