Archive for June, 2009

Upgrade MySQL to MySQL 5.1 in a Cpanel server

Wednesday, June 17th, 2009

First ascertain the current version of mysql installed, the system architecture and OS release

rpm -qa|grep -i mysql
MySQL-devel-5.0.81-0.glibc23
MySQL-shared-5.0.81-0.glibc23
MySQL-client-5.0.81-0.glibc23
MySQL-server-5.0.81-0.glibc23
MySQL-bench-5.0.81-0.glibc23
arch
x86_64
cat /etc/redhat-release
CentOS release 5.3 (Final)

Next step is to download the latest MySQL 5.1 community release matching the OS and architecture from
http://dev.mysql.com/downloads/mysql/5.1.html#downloads

wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.35-0.rhel5.x86_64.rpm/from/http://mirror.csclub.uwaterloo.ca/mysql/
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-client-community-5.1.35-0.rhel5.x86_64.rpm/from/http://mirror.csclub.uwaterloo.ca/mysql/
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-shared-community-5.1.35-0.rhel5.x86_64.rpm/from/http://mirror.csclub.uwaterloo.ca/mysql/
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-devel-community-5.1.35-0.rhel5.x86_64.rpm/from/http://mirror.csclub.uwaterloo.ca/mysql/

The download folder should look something like

ls
./ MySQL-client-community-5.1.35-0.rhel5.x86_64.rpm MySQL-server-community-5.1.35-0.rhel5.x86_64.rpm
../ [...]

MySQL master slave replication of multiple databases

Sunday, June 14th, 2009

On the master server :
We have to enable networking ;if it is skipped. Enable binary logging and start a binary log of all databases
Add the following to the my.cnf file and restart MySQL

server-id = 1
log-bin=mysql-bin
binlog-do-db=gnusys_kb
binlog-do-db=gnusys_wiki
binlog-do-db=powerdns

create a user on the master with replication slave privileges on all databases from [...]