You said your database name is typen, and generally default database username is root with no password.
Try below code:
$servername = "localhost";
$username = "root";
$password = "";
$db = "typen";
$conn = new mysqli($servername, $username, $password,$db);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";