Setting Up PHPMyAdmin

July 22nd, 2010 — 3:57pm

Related Post
* MySQL
* PHP
* Apache

Compiling libmcrypt

root@linux:~ # wget -c 'http://easynews.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz'
root@linux:~ # gunzip libmcrypt-2.5.7.tar.gz
root@linux:~ # tar -xvf libmcrypt-2.5.7.tar
root@linux:~ # cd libmcrypt-2.5.7
root@linux:~ # ./configure --disable-posix-threads
root@linux:~ # make && make install


Config mcrypt extension for PHP5

root@linux:~ # cd php-5.2.10/ext/mcrypt/
root@linux:~ # phpize ; aclocal
root@linux:~ # ./configure
root@linux:~ # make && make install
root@linux:~ # vi /usr/local/lib/php.ini
   #Add or Edit the following line#
   extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"
   extension=mcrypt.so

Config mbstring extension for PHP5

root@linux:~ # cd php-5.2.10/ext/mbstring/
root@linux:~ # phpize ; aclocal
root@linux:~ # ./configure
root@linux:~ # make && make install
root@linux:~ # vi /usr/local/lib/php.ini
   #Add or Edit the following line#
   extension=mbstring.so


Installing & Configure PHPMyAdmin

root@linux:~ # wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.10/phpMyAdmin-2.11.10-english.tar.gz?use_mirror=cdnetworks-us-2&ts=1279762815
root@linux:~ # tar -zxvf phpMyAdmin-2.11.10-english.tar.gz
root@linux:~ # mv phpMyAdmin-2.11.10-english.tar.gz /home/mywebsitehtdocs/phpmyadmin/
root@linux:~ # cd /home/mywebsitehtdocs/phpmyadmin/
root@linux:~ # cp config.sample.inc.php config.inc.php
root@linux:~ # vi config.inc.php
   $cfg['blowfish_secret'] = 'fdf943893h8fhu1imvzpe9'; ##Just type your long random character##
   $cfg['Servers'][$i]['AllowNoPassword'] = false;
   $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';

Restart Apache2

root@linux:~ # /usr/local/apache2/bin/apachectl restart

Comment » | Linux

MySQL Master Master Replication

July 22nd, 2010 — 3:39pm

As described in the previous post about MySQL Master Slave Replication. This is how to setting up MySQL Master Master Replication.

Master address 192.168.10.1
Slave address 192.168.10.2

Setup Slave

* Edit mysql configuration file on /etc/my.cnf

root@slave:~#nano /etc/my.cnf
log-bin=mysql-bin
binlog-ignore-db="mysql"

* Create a Replication Slave privileges on the Slave for the original Master server:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.47-log Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT REPLICATION SLAVE ON *.* TO replication@"192.168.10.1" IDENTIFIED BY 'password123#';
mysql> flush privileges;
mysql> exit
Bye

* Restart Slave MySQL service

root@slave:~# killall -9 mysqld mysqld_safe
root@slave:~# /usr/local/mysql/bin/mysqld_safe --user=mysql &

* Get the binary position of the data

mysql> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 |      106 |              | mysql            |
+------------------+----------+--------------+------------------+
1 row in set (0.01 sec)

Note the File row and Position row for use on the original Master server.
Continue reading »

Comment » | Linux

Back to top