<body>
<?php
$servername = "localhost";
$username = "your_username";
$password = "your_password";
$dbname = "your_dbname";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT message FROM messages";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<h1>Message: " . $row["message"] . "</h1>";
}
} else {
echo "0 results";
}
$conn->close();
?>
</body>
</html>
```
Finally, here's the JavaScript code to create an alert with the "Hello, World!" message:
```javascript
window.onload = function() {
alert("Hello, World!");
}
```
This example should give you a basic understanding of how to create a "Hello, World!" program using PHP 8, HTML5, CSS3, MySQL, and JavaScript, as well as how to retrieve and display the message from a MySQL database.