Skip to content

Instantly share code, notes, and snippets.

View seriquynh's full-sized avatar

Quynh Nguyen seriquynh

View GitHub Profile
@seriquynh
seriquynh / mysql-connect.php
Last active November 12, 2024 04:11
Test MySQL connection using PDO
<?php
$host = '192.168.33.10';
$port = 3360;
$user = 'forge';
$password = 'password';
$dbname = 'testdb';
try {
$pdo = new PDO("mysql:host=$host;port=$port;dbname=$dbname", $user, $password);