I've been using mysqldump in a Perl script for a client of mine to do database dumps for several years and until recently it has worked fine.

However I noticed that in a recent dump, no data or schema was created.

Since I don't know for sure where 'mysqldump' is located on the remote system I use 'whereis' to find it. Then I use the first path I find. Here are the paths containing 'mysql':

/usr/bin/mysql
/usr/lib/mysql
/usr/include/mysql
/usr/share/mysql

My command string is then similar to this:
usr/bin/mysqldump -uusername -ppassword database_name >> mydatadump.sql

Now this command produces this output file:
-- MySQL dump 10.10
--
-- Host: localhost    Database: database_name
-- ------------------------------------------------------
-- Server version       5.0.27

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

Previous outputs had header data:
-- MySQL dump 8.23
--
-- Host: localhost    Database: database_name
---------------------------------------------------------
-- Server version       3.23.58

So it appears the host has updated the MySQL server, and of course mysqldump is new. Now my script is broken until I patch my code with a new set of parameters. I would not have discovered this unless I had been doing some poking around on the server. This is very frustrating and potentially dangerous, since my client could have done a dump / restore not knowing there wasn't really a dump to work with.

Has anyone else had this problem, and hopefully got a working solution? If this is going to keep happening every time the server gets updated then I (and lots of others I assume) will have to find an alternative way to let my client do backups.
--
Amer Neely - Web Mechanic
w: www.webmechanic.softouch.on.ca/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to