Once you have whitelisted an IP address on the Nobregas MySQL Panel, you can connect to your database remotely from any application, server, or development tool. This guide covers the connection details you need and how to connect from common environments.
Prerequisites
Before connecting remotely, ensure:
- A database exists — Created on the Databases page.
- A database user exists — With a grant that includes the target database.
- The remote IP is whitelisted — Added on the Databases page in the Remote MySQL — Allowed IPs section.
Finding Your Connection Details
- Go to Databases in the top navigation bar.
- Find your database and view its connection details:
- Hostname — The server address (e.g.,
node1.mysql.nobregas.org). - Port — The MySQL port (typically
3306). - Database Name — Your database name (e.g.,
u24a5d4_mysite).
- Hostname — The server address (e.g.,
- You also need the username and password of a database user with grant access to this database.
Use the copy buttons next to each field to copy values accurately.
Connecting from Common Environments
PHP (PDO)
$host = 'node1.mysql.nobregas.org';
$port = 3306;
$db = 'u24a5d4_mysite';
$user = 'u24a5d4_admin';
$pass = 'your_password';
$pdo = new PDO("mysql:host=$host;port=$port;dbname=$db;charset=utf8mb4", $user, $pass);
PHP (mysqli)
$conn = new mysqli('node1.mysql.nobregas.org', 'u24a5d4_admin', 'your_password', 'u24a5d4_mysite', 3306);
Node.js (mysql2)
const mysql = require('mysql2');
const connection = mysql.createConnection({
host: 'node1.mysql.nobregas.org',
port: 3306,
user: 'u24a5d4_admin',
password: 'your_password',
database: 'u24a5d4_mysite'
});
Python (PyMySQL)
import pymysql
connection = pymysql.connect(
host='node1.mysql.nobregas.org',
port=3306,
user='u24a5d4_admin',
password='your_password',
database='u24a5d4_mysite'
)
MySQL CLI
mysql -h node1.mysql.nobregas.org -P 3306 -u u24a5d4_admin -p u24a5d4_mysite
Laravel (.env)
DB_CONNECTION=mysql
DB_HOST=node1.mysql.nobregas.org
DB_PORT=3306
DB_DATABASE=u24a5d4_mysite
DB_USERNAME=u24a5d4_admin
DB_PASSWORD=your_password
WordPress (wp-config.php)
define('DB_NAME', 'u24a5d4_mysite');
define('DB_USER', 'u24a5d4_admin');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'node1.mysql.nobregas.org:3306');
Troubleshooting Connection Issues
| Problem | Solution |
|---|---|
| Connection refused | Verify the IP is whitelisted on Remote Access |
| Access denied | Check username, password, and database grant |
| Unknown host | Verify the hostname from the Databases page |
| Timeout | Check your firewall allows outbound connections on port 3306 |
Security Recommendations
- Never hardcode credentials in source code committed to version control. Use environment variables or config files excluded from Git.
- Use SSL/TLS when available for encrypted connections.
- Restrict user privileges to only what the remote application needs.
- Remove the whitelisted IP when remote access is no longer needed.