MySQL

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 http://www.postgresql.org

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.

Subject: 

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.

Subject: 

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.

Subject: 

mysqltuner.pl

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

#!/usr/bin/perl -w
# mysqltuner.pl - Version 1.0.0
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2008 Major Hayden - major@mhtx.net
#
# For the latest updates, please visit http://mysqltuner.com/
# Subversion repository available at http://tools.assembla.com/svn/mysqltuner/
#
# 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,

Subject: 

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
table_cache=750
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
log-queries-not-using-indexes

replicate-do-db=test

replicate-do-db=test2

binlog_cache_size=128K

Subject: 

Pages

Subscribe to RSS - MySQL