Cannot connect to mysql server

Please excuse my terminology as I am new here :smiley: I have successfully set up WAMP and am now trying to access mysql server so I can then access a db. I am getting error "Unable to connect to the database server"in reference to line 2 “$link = mysqli_connect(‘localhost’, ‘root’, ‘password’);” I have checked that mysqld.exe is running in task manager which it is. I do not have a password set / do a need to, or will the default password “password be ok as the Wampserver is not online”
My index.php file is

<?php
$link = mysqli_connect('localhost', 'root', 'password');
if (!$link)
{
$output = 'Unable to connect to the database server.';
include 'output.html.php';
exit();
}
if (!mysqli_set_charset($link, 'utf8'))
{
$output = 'Unable to set database connection encoding.';
include 'output.html.php';
exit();
}
if (!mysqli_select_db($link, 'ijdb'))
{
$output = 'Unable to locate the joke database.';
include 'output.html.php';
exit();
}
$output = 'Database connection established.';
include 'output.html.php';
?>

and my output.html.php file is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PHP Output</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"/>
</head>
<body>
<p>
<?php echo $output; ?>
</p>
</body>
</html>

Thanks Pedro.

Edit - I just left the password field blank and it connected. Is this OK as long as the server is not online?

Last I knew the default password was empty “” not “password”.

You’ll get pestered my “not secure” warnings, but on a localhot that only you will be using it should be OK without one.

Thanks Mittineague