How can we help?

Help via Chat from monday to friday

Connecting my website to a database

On this guide you will find some examples of how to configure your website's connection to a database at Umbler.

All the database information is available in the Database tab in your Control Panel. To connect to a database at Umbler from an external host, like your local computer, external access to the database must be allowed in the Control Panel.

PHP with MySQL

$mysqli = new mysqli("", "user", "password", "database");

PHP with Mongo

$connection = new MongoClient( "mongodb://" );

Node with MySQL

const mysql = require('mysql');
const connection = mysql.createConnection({
  host: '',
  user: 'user',
  password: 'password',
  database: 'database'
connection.connect((err) => {
  if (err) throw err;

Node with Mongo

var MongoClient = require('mongodb').MongoClient
    , format = require('util').format;

MongoClient.connect('mongodb://', function(err, db) {
    if(err) throw err;