<?php
try {
    $pdo = new PDO('mysql:host=127.0.0.1;port=3306;charset=utf8mb4', 'root', '', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
    echo "Connected to MySQL\n";
    $pdo->exec('DROP DATABASE IF EXISTS `adenium_db`');
    echo "Dropped adenium_db if it existed\n";
    $pdo->exec('CREATE DATABASE `adenium_db` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
    echo "Created adenium_db\n";
    echo "Please rerun php artisan migrate after this script completes.\n";
} catch (Exception $e) {
    echo 'ERROR: '.$e->getMessage()."\n";
}
