02 Jun

Setup and configure MySQL backup using Holland and Xtrabackup

Setting up a database backup is a primary task for database administrators and we see perl and shell scripts wrapped around few of the backup-tools in practice. With right tools things can look easy and today we shall look into one of that!

MySQL Database backup can be done with mysqldump, mysqlhotbackup, xtrabackup, lvm / file-system snapshots or doing delimited-text file backups.

In this post we will learn setting up and configuring MySQL backup using Holland backup framework & Xtrabackup. We won’t be needing any scripts :) (let’s have short intro first…)

Read More

20 May

Cannot connect to MySQL server on ‘localhost': Cacti Error

I was installing and setting up Cacti recently and faced following error:

“FATAL: Cannot connect to MySQL server on ‘localhost’.”

This post includes debugging steps and solution for the issue.

Along with the Cacti’s web-interface, the poller.php was generating the same error as follows:

root@ubuntu:/var/www/cacti# php /var/www/cacti/poller.php
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

Read More

28 Apr

How-to extract from mysqldump | mysql-dump-splitter recipes

The latest mysqldumpsplitter (v 5.0) is out. I’d like to make it easier for everyone to get started with it.  So in this post you’ll get a quick & handy command-line “recipe” for extracting table, database  or more from mysqldump.

The Mysqldumpsplitter can extract database, table, all databases, all tables or tables matching on regular expression. It can also extract multiple tables from one database or describe the contents from a mysqldump.

The tool can extract a MySQL database from a compressed or uncompressed mysqldump. It by default produces the compressed output of sqls in default out directory but you can specify target directory or uncompressed output as well.

Check out more  on recipe commands to use the mysqldumpsplitter.

Continue Reading…

23 Mar

MySQL:The user specified as a definer does not exist (error 1449)-Solutions

The self-explanatory error that led this post is:
MySQL error 1449: The user specified as a definer does not exist.
I wrote about DEFINER & INVOKER SQL SECURITY in MySQL long back in early 2012 which covers the explanation of how they work WRT stored routines in MySQL!

Here I’ll try to extend it little more with examples for the error and provide 3 solutions.
Continue Reading…

10 Mar

10 useful shell script code snippets | Linux

This post is collection of 10 useful unix / linux shell script code snippets I’ve often used.

Following these code snippet you will be able to answer following questions:
1. How to calculate script run-time in shell.
2. How to parse parameters / arguments to shell script.
3. How to safely change a directory in shell script.
4. How to check if a command was successful in shell script.
5. How to add timestamps in script log output.
6. How to check if a process is running.
7. How to colour your script output.
8. How to read variables from config file.
9. How to loop over files in a folder.
10. How to perform actions based on variable value using SWITCH…CASE

And a bonus snippet
11: How to send emails from shell script.

Let’s begin.
Continue Reading…

-- Kedar Vaijanapurkar --