Trongate Docs
switch to dark modeswitch to dark mode
»
»
Getting Started

Getting Started

Database Compatibility

Trongate's Model file uses PDO for database interaction.  PDO is a library that comes with most installations of PHP.  It's free of charge.  PDO can work with the following databases:

  • ​MySQL
  • MariaDB
  • PostgreSQL
  • Oracle
  • Firebird
  • MS SQL Server
  • Sybase
  • Informix
  • FreeTDS
  • SQLite
  • Cubrid
  • 4D

Just To Let You Know
At the time of writing, Trongate has only been tested with MySQL and MariaDB.  However, if anyone out there has acquired experience or additional information in using Trongate with any of the other database types, please do reach out and let us know.

The Database Config File

Trongate establishes a database connection by referencing a database configuration file named database.php. This file can be found inside the 'config' folder of your web app.

The precise settings required here depend on your particular installation and database of choice.  Nevertheless, below is an example of a configuration file for a database - stored on 'localhost' - named 'waterways'.

<?php
//Database settings
define('HOST', '127.0.0.1');
define('PORT', '3306');
define('USER', 'root');
define('PASSWORD', '');
define('DATABASE', 'waterways');

Top Tip
When you're working with a database that is stored locally (i.e., a database that is on your computer), you can often have 'localhost' declared as your host and, in most instances, everything will work fine.  However, it's a much better practice to use 127.0.0.1 instead of localhost.  When you use 'localhost', your computer maps the host to the 127.0.01 IP address.  By entering the IP address, you're effectively skipping a step.  More importantly, 127.0.0.1 has been proven to be a little more robust - particularly for users who use third party database management software like Navicat or the Trongate Desktop App.

The bottom line is, it's better to use 127.0.0.1 instead of 'localhost'.



HELP & SUPPORT

If you have a question or a comment relating to anything you've see here, please goto the Help Bar.

 
×