Installation (on both Master and Slave Nodes): yum install https://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm yum install postgresql95 postgresql95-server postgresql-libs postgresql95-contrib rsync Initialize the database and configure postgresql /usr/pgsql-9.5/bin/postgresql95-setup…
Category: Database
Database Tutorials and Tips
Some times, you might want to run a query without slave updating with that query. In that case, you would have to avoid writing the…
There are times, when you may come across this situation, when you are not able to grant permission to a new user, even when you…
#!/bin/bash emailAddress="emailtoNotify@domain.com" cmd=`mysql -e ‘show slave status\G’ | grep Slave_SQL_Running | awk ‘{print $2}’` if [ "$cmd" == "No" ];then MSG="Mysql Replication Broken on `hostname`,…
Web server is not able to access your session directory. Change the permissions. chown -R root:apache /var/lib/php/session
MySQL Database Backup Ignore one or more tables while doing mysqldump : mysqldump -u username -p database –ignore-table=db.table1 –ignore-table=db.table2 > mysqldump.sql Compress the output of…
Lets assume the two servers to be serverA and serverB Create the certificates to use with mysql replication: openssl genrsa 2048 > ca-key.pem openssl req…
Delete Rows based on output from a query : DELETE FROM Table1 WHERE EXISTS(SELECT 1 FROM Table2 WHERE Table2.Group = Table1.Group) or delete from Table1…
#!/bin/bash #Author : Amit K Nepal #Last Modified : Nov 01 2011 BACKUP_DIR=/db_backups DB_NAME=dbname TSTAMP=`date +%Y%m%d` FILENAME=$BACKUP_DIR/$DB_NAME.gz Notify=1 Rotate=8 logfile=$BACKUP_DIR/backup.log echo “………….Backup Script Running on…
View Mysql Process list with full query : show full processlist \G Disable Binary Logging SET sql_log_bin = 0;