Mark Foster's Blog

Misadventures in Technology

Entries for the ‘Databases’ Category

PHP/Apache running on Linux won’t connect to a PostgreSQL server

SELinux will block PHP/Apache from connecting to PostgreSQL (and probably any other DB) by default on some Linux distributions. If you are trying to get PHP to connect to a PostreSQL DB on a linux box for the first time and you are sure your pg_hba.conf on the target box is setup correctly then try [...]

How to get the contents of an Oracle CLOB data field in PHP

The Oracle “CLOB” (Character Large Object) is a data type used to store up to 4 Gigabytes of text. Retrieving the contents of a CLOB is not as intuitive as you might think. Let’s say you have a CLOB field/column named “mychars” in an Oracle DB table named “mytable” along with some other fields. You [...]

Setting up PostgreSQL on Linux and connecting using pgAdmin III

In my previous post I covered setting up/installing MySQL and connecting via MySQL Administrator from a remote host. In this post I will talk about the PostgreSQL equivalent. As a side note, any database system should always be behind a firewall of some kind. Putting up a database server on a public IP using the [...]

Setting up MySQL on Linux and connecting using MySQL Administrator

There are a few “gotchas” if you are trying to setup MySQL on Linux server, Ubuntu in this case, and connect to it using MySQL Administrator from somewhere else. Here is what worked for me… Install MySQL server and MySQL GUI Tools To install MySQL on a Ubuntu server use: sudo apt-get install mysql-server If [...]