Open source SQL database often used on Linux with Apache and PHP (LAMP)

PostgresQL on Fedora

Installing PostgreSQL on Fedora Core

This will install the PostgreSQL database server and the component required to write PHP scripts that communicate with postgres. We use yum to handle dependencies and gather all of the required packages. For more information on PostgreSQL, see

1. Install PostgreSQL and the component that allows php to talk to PostgreSQL.

 yum -y install postgresql postgresql-server php-pgsql 

2. Configure the new service to start automatically

  /sbin/chkconfig postgresql on
/sbin/chkconfig postgresql initdb
/sbin/service postgresql start

3. Start the postgresql interactive shell and create your first user and database.


Convert your MySQL database from MyISAM to InnoDB

Before you go any further backup your database before doing any steps below. If you 'splode your database for any reason, you'll need it.

Here are the steps:

1. Shutdown MySQL

2. Move/copy/change the name of ib_logfile0 and ib_logfile1 files. (find where MySQL exists on your system - locations can vary greatly). MySQL will recreate these files when you start it up again. Not anytime you change the innodb_log_file_size parameter you will need to shutdown MySQL, move these files, and start up MySQL again.


How to optimize mysql tables in Drupal

How to optimize my Drupal database?

The easiest way is to install the DB Maintenance module. Information on how to install a Drupal module is available in our Drupal tutorial.

After the module is installed and activated, you can access it from your Drupal admin area >  Administer > Site configuration > DB maintenance. Select the tables which you wish to optimize and click Optimize now.


Use the following script to analyze MySQL database for tuning purposes.

#!/usr/bin/perl -w
# - Version 1.0.0
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2008 Major Hayden -
# For the latest updates, please visit
# Subversion repository available at
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,


MySQL Replication

These are the steps to set up Master/Slave replication on MySQL

mysql> grant replication slave, replication client on *.* to
repl@'10.%' identified by 'rvisitor';

mysql> show master status;

Change on my.cnf on salve
query_cache_size = 32M
query_cache_limit = 512K
#replication settings
log_bin = replicate/mysql-bin
server_id = 20
relay_log = mysql-relay-bin
log_slave_updates = 1
log-slow-queries = mysql-slow-queries
long_query_time = 1






Subscribe to RSS - MySQL