I think you can't connect MySQL database in html page directly but there is some way to hiding the backhand/server side scripting code's and display html pages. now I am talking about php(because of WAMP).
Create a php file first to make connection to mysql
for example connect.php
<?
$host="localhost";
$db_user="root";
$db_password="";
$database="test";
$link = mysql_connect($host,$db_user,$db_password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
else
{
echo "Mysql Connected Successfully";
}
mysql_close($link);
?>
and Create a Index.html using ajax
<html>
<head>
<script type="text/javascript">
function checkmyconnect()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","connect.php",true);
xmlhttp.send();
}
</script>
</head>
<body>
<h2>Let Connect to mysql in html file</h2>
<div id="myDiv">No connection</div>
<button type="button" önclick="checkmyconnect()">Check Mysql connection</button>
</body>
</html>
and test now