How to setup multiple installations of MySQL & PostgreSQL

We need to use:

MySQL

[mysqld]
port            = 3306
socket          = /tmp/mysql-5.1.sock

# scripts/mysql_install_db --user=mysql --datadir=data

# ./bin/mysqld_safe --defaults-file=/usr/local/mysql-5.1/my.cnf &

# ./bin/mysql --socket=/tmp/mysql-5.1.sock -uroot -p

# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.

basedir=/usr/local/mysql-5.1
datadir=/usr/local/mysql-5.1/data

postgresql

--prefix=/usr/local/pgsql-8.0.12

--with-pgport=5430

# useradd -r -m -d /var/lib/pgsql postgres

# mkdir -p /var/lib/pgsql/8.0.12/data
# chown -R postgres: /var/lib/pgsql
# su postgres
bash-3.00$ /usr/local/pgsql-8.0.12/bin/initdb -W -A md5 -D /var/lib/pgsql/8.0.12/data 
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_GB.UTF-8.
The default database encoding has accordingly been set to UNICODE.

fixing permissions on existing directory /var/lib/pgsql/8.0.12/data ... ok
creating directory /var/lib/pgsql/8.0.12/data/global ... ok
creating directory /var/lib/pgsql/8.0.12/data/pg_xlog ... ok
creating directory /var/lib/pgsql/8.0.12/data/pg_xlog/archive_status ... ok
creating directory /var/lib/pgsql/8.0.12/data/pg_clog ... ok
creating directory /var/lib/pgsql/8.0.12/data/pg_subtrans ... ok
creating directory /var/lib/pgsql/8.0.12/data/base ... ok
creating directory /var/lib/pgsql/8.0.12/data/base/1 ... ok
creating directory /var/lib/pgsql/8.0.12/data/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/8.0.12/data/base/1 ... ok
initializing pg_shadow ... ok
Enter new superuser password: 
Enter it again: 
setting password ... ok
enabling unlimited row size for system tables ... ok
initializing pg_depend ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok

Success. You can now start the database server using:

    /usr/local/pgsql-8.0.12/bin/postmaster -D /var/lib/pgsql/8.0.12/data
or
    /usr/local/pgsql-8.0.12/bin/pg_ctl -D /var/lib/pgsql/8.0.12/data -l logfile start

# cp /usr/local/src/postgresql-8.0.12/contrib/start-scripts/linux /etc/init.d/postgresql-8.0
# chkconfig --add postgresql-8.0
# chmod +x /etc/init.d/postgresql-8.0


CategoryLinux CategoryDatabase

MultipleMySQLPostgreSQLVersions (last edited 2009-05-05 13:57:47 by DavidKeen)