Kunaljain's Weblog

February 10, 2009

Removing RPM packages

Filed under: Linux Tips & Tricks,MySql — Kunal Jain @ 04:14
Tags: ,

Try to remove MySQL from my server which my datacenter guys installed it along with the OS and while doing that i got the following error

shell> rpm -aq | grep mysql | xargs rpm -e

error: “mysql-devel-5.0.45-7.el5” specifies multiple packages
error: “mysql-5.0.45-7.el5” specifies multiple packages
error: “mysql-devel-5.0.45-7.el5” specifies multiple packages
error: “mysql-5.0.45-7.el5” specifies multiple packages

Then i google about this error and with some help from google and rpm manual i use the following command to remove MySQL from my server

shell > rpm -aq | grep mysql | xargs rpm -e --nodeps --allmatches
Advertisements

January 9, 2009

ERROR: 1062 Duplicate entry ‘localhost-‘ for key ‘PRIMARY’

Filed under: MySql — Kunal Jain @ 11:47
Tags: ,

If MySQL give this error then check your hostname

shell> hostname

It might be localhost. Change your hostname. To know how to change hostname click here

February 26, 2008

Automated backup script for Mysql

Filed under: MySql — Kunal Jain @ 17:41
Tags: , , ,

Open a file backup.sh and add the following lines in the file. Change UserName and Password with actual Username and Password.

/usr/local/mysql/bin/mysqldump --user=UserName --password=Password --lock-all-tables --all-databases | gzip > /home/user/backup/mysql/backup.sql.gz
cd /home/user/backup/mysql/
CURR=`date +%Y%m%d`
mv backup.sql.gz archives/backup.sql.gz.$CURR

This script create the file in archives folder in a gzip format.

Blog at WordPress.com.