Archive for the ‘MySQL Server’ Category

Mysql Server processlist shows negative value(-) in connect column for system user

Wednesday, June 9th, 2010

Some times process list out put show negative value like bellow :
Command :

watch /usr/local/mysql/bin/mysqladmin -ppass processlist

8 | system user | | Connect | -1247 | Has read all relay log; waiting for the slave I/O thread to update it |
One of the reason :
make sure both Server has same [...]

How To Set Up MySQL Database Replication With SSL Encryption

Wednesday, June 9th, 2010

Step1 :
Set up normal replication first and find out if mysql server is compiled with ssl supports
Ref:http://www.fosiul.com/index.php/2009/11/mysql-server-master-master-active-active-replication/
Bellow commands will verify if mysql server is compiled with ssl supports

SHOW VARIABLES LIKE ‘have_openssl’;

output :
Step2 :
in Server1 :
(a)Create Self signed certificate .
Note : While Creating self signed certificate use different common name for each certificate,other wise it will [...]

Mysql server master master active active replication

Tuesday, November 24th, 2009

Ref: http://www.howtoforge.com/mysql_master_master_replication
a) Create user name and password for replication on both servers by using this command
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO noslave@’host-name’ IDENTIFIED BY ’some-pass’;
b) Configuration for Server 1 To make it primary Server for Server2
vi /etc/my.cnf
log-bin=mysql-bin
binlog-do-db=fosiul     # which Database to replicate
binlog-do-db=hesk      # Which Database to replicate
binlog-ignore-db=mysql  # Which Database to ignore
binlog-ignore-db=test       # [...]

How to install innotop

Thursday, November 19th, 2009

a)Download innotop from http://code.google.com/p/innotop/
b)cd /tmp
c) tar -xvzf innotop-1.7.2.tar.gz
d) cd innotop-1.7.2
e) perl per Makefile.PL
f) Make install
NOte : if you see error like this :
Looks good
Warning: prerequisite DBD::mysql 1 not found.
Warning: prerequisite DBI 1.13 not found.
Warning: prerequisite Term::ReadKey 2.1 not found.
Writing Makefile for innotop
Solution :
yum install perl-DBD-MySQL
yum install perl-TermReadKey
Run innotop : perl /usr/bin/innotop –password “your password”

How to install apache2-php-mysql from source

Thursday, September 10th, 2009

Prerequisite : yum install gcc-c++ gcc make ncurses-devel openssl-devel
Packages required for php: yum install libjpeg-devel libpng-devel curl-devel libmcrypt-devel krb5-devel
Apache Server Installation from Source:
Apache installation directory is : /usr/local/apache
a) Download the apache source file from : http://httpd.apache.org/download.cgi
b) Download the source file in to /tmp directory.
c) I am guessing the source file is httpd-2.2.13.tar.gz
d) Cd /tmp
e) tar –xvzf httpd-2.2.13.tar.gz
f) cd httpd-2.2.13
g)

 
./configure –prefix=/usr/local/apache [...]

How to optimize Thread Cache variables for MySQL server

Monday, August 17th, 2009

If you have a busy server that’s getting a lot of quick connections, set your thread cache high enough that the Threads_created value in SHOW STATUS stops increasing. Your CPU will thank you.
Ref : http://jeremy.zawodny.com/blog/archives/000173.html
“As soon as I optimized the thread cache, MySQL’s server load dropped over 50%!”
Ref: http://www.epigroove.com/posts/63/optimize_mysql_the_thread_cache
How to set thread cache :
You [...]

How to optimized MySql server

Monday, August 17th, 2009

Ref: MySQL® 5 Certification Study Guide
Ref: High performace MySQL

The MyISAM Key Cache
The MyISAM key block size
The Thread Cache
The Table Cache

Master to slave and slave to master replication

Wednesday, August 12th, 2009

Master :
1. Create user and give the privileges:
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO reply@’host-name’ IDENTIFIED BY ’some-pass’;
2. Define the log setting in my.cnf
log-bin = mysql-bin
server_id = 2
3. Restart the server /etc/init.d/mysqld restart
4. check the status of the server by : show master status\G;
Slave :
1. Enable necessary log:
log-bin = mysql-bin
server_id = 3
relay-log [...]

Query Cache in mysqlserver

Wednesday, August 12th, 2009

Ref:MySQL® 5 Certification Study Guide
Ref:Hight Performance Mysql Server(2nd Edition)
Ref:http://dev.mysql.com/doc/refman/5.1/en/query-cache.html
Ref:http://www.mysqlperformanceblog.com/2006/07/27/mysql-query-cache/
How to find out if Query Cache is enabled:
mysql> SHOW VARIABLES LIKE ‘have_query_cache’;
+——————+——-+
| Variable_name | Value |
+——————+——-+
| have_query_cache | YES |
+——————+——-+

How to enable Query Cache:

Edit my.cnf file and Add as bellow:
[mysqld]
query_cache_type = 1
query_cache_size = 10M
query_cache_limit = 2M
Bellow Command will [...]