Archive for July 2010


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

How to fix /bin/sh: bad interpreter: Permission denied

July 13th, 2010 — 10:50pm

When i try to execute mysql_install_db on /home directory, i got an error like :

root@linux:~# /home/data/mysql/bin/mysql_install_db --user=mysql --basedir=/home/data/mysql
-bash: /home/data/mysql/bin/mysql_install_db: /bin/sh: bad interpreter: Permission denied

After I did some searching on google the problem was “no shell” in /home/data/ directory. And here is how to investigate and fix that problem :

root@smsgateway:~# mount | grep /home/data
/dev/sdb1 on /home/data type ext3 (rw,nosuid,nodev,noexec)

root@smsgateway:~# mount -o remount,exec /home/data/

Comment » | Linux

Back to top