Db-Connection错误

I get these errors trying to connect to my database:

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\Vehicleshowroom\dbconnection.php on line 2

Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\xampp\htdocs\Vehicleshowroom\dbconnection.php on line 5 could not connect

Code is

<?php 
    $con=mysqli_connect("localhost","root", "technology","vehicleshowroom"); 
    if(!$con) { 
       die("could not connect".mysqli_error()); 
    } 
?>

<?php

$con = mysqli_connect("localhost", "root", "", "vehicleshowroom");

if (mysqli_connect_errno()) {
    echo mysqli_connect_error();
    exit();
}
?>

</div>