errno: 150 "Foreign key constraint is incorrectly formed"
It starts to work on 5.7.27 if second table uses matching DEFAULT CHARSET and COLLATE options:

CREATE TABLE IF NOT EXISTS `login`(
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `username` varchar(50) NOT NULL,
    `password` varchar(20) NOT NULL,
    PRIMARY KEY (`username`),
    FOREIGN KEY(`id`) REFERENCES `Register_Per`(`id`) 
) Engine=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;