Blog / Database

Migrating WordPress from a shared hosting environment to a virtual private server

November 9, 2011

I was migrating this WordPress blog early this morning from Bluehost to a dedicated Rackspace Cloud Server that I’m already using for a web application I’m writing. It was almost painless! Just ran into a few minor post-migration issues.

The reason I’m migrating is mainly because I want more control, like being able to use my own self-signed SSL certificate without paying extra, for example. I figured since I’m getting very low traffic it really …

How to allow remote connections to your PostgreSQL 9.0 database server on Ubuntu 10.04 LTS

September 8, 2011

Change directory to /etc/postgresql/9.0/main and modify the following configs (I know you’re sick of hearing this, but I recommend you back up your original configs before making any changes):

postgresql.conf

In “Connections and Authentication” section:

From

#listen_addresses = 'localhost'
#password_encryption = on

To

listen_addresses = '*'
password_encryption = on

pg_hba.conf

From

host    all    all    127.0.0.1/32    md5
host    all    all    ::1/128         md5

To

host    all    all    0.0.0.0/0   md5
host    all    all    ::0/0       md5

Restart the ssh …

How to import data from a CSV file into a PostgreSQL database

April 19, 2011

I was working on my personal project last week and needed to import some data in CSV format to a PostgreSQL database. I wanted only certain fields to be imported so I had to specify this in the command. I’m new to PostgreSQL so it took me quite a bit of Googling to figure out exactly how to do this.

Here’s how I did it on Ubuntu 10.04 LTS, ‘glucosetracker’ is the name of my …

How to check the progress of the ‘Shrink Database’ task in SQL Server 2005

August 15, 2009

My first blog post in a long time!

So I archived some data from our database yesterday and I needed to shrink the database file so I ran the “Shrink Database” task in Management Studio. The database is over 500GB in size and I checked 7 hours later and the database shrink operation is still going. I got a little worried because someone needs to use this database today and I’m not sure if the …

Can’t connect to SQL Server 2005 using PHP

October 21, 2008

I was updating our web application last Friday and I needed it to connect to an SQL Server 2005 Express Edition database to query some tables but my application couldn’t connect to the MSSQL server.

After a few hours of searching the internet and trying different things I finally got it to work by downloading a newer version of ntwdblib.dll (version 2000.80.194.0) and replacing the one that came with PHP 5.2 (we’re using WAMP (Windows, …