10 messages in com.mysql.lists.bugsmysqldump called by cron contains no ...| From | Sent On | Attachments |
|---|---|---|
| Bernhard Erdmann | 06 Jul 2003 10:33 | |
| Sinisa Milivojevic | 07 Jul 2003 11:53 | |
| Bernhard Erdmann | 07 Jul 2003 11:53 | |
| Sinisa Milivojevic | 07 Jul 2003 12:11 | |
| Bernhard Erdmann | 07 Jul 2003 12:20 | |
| Sinisa Milivojevic | 07 Jul 2003 12:31 | |
| Bernhard Erdmann | 07 Jul 2003 12:45 | |
| Sinisa Milivojevic | 07 Jul 2003 12:55 | |
| Bernhard Erdmann | 07 Jul 2003 13:05 | |
| Eric Frazier | 07 Jul 2003 18:47 |
| Subject: | mysqldump called by cron contains no data (MySQL 4.0.12)![]() |
|---|---|
| From: | Bernhard Erdmann (be...@berdmann.de) |
| Date: | 07/06/2003 10:33:55 AM |
| List: | com.mysql.lists.bugs |
Hi,
mysqldump --all-databases --opt of MySQL 4.0.12 called by cron for user mysql does not contain any INSERT statements nor any CREATE TABLE statements.
No regular unattended backup of MySQL DBs is possible.
The same command started from command line prints all the data.
Environment: RedHat Linux 6.2 i386 with Kernel 2.4
This script is called by cron:
#!/bin/sh umask 077 DATE="`date +%Y%m%d%H%M`" BACKUPDIR=/var/backup/mysql BACKUPFILE=db-${DATE}.sql.gz export PATH=/opt/mysql/bin:$PATH mysqldump --all-databases --opt | gzip > $BACKUPDIR/$BACKUPFILE
The gunzipped backupfile contains:
-- MySQL dump 9.07
-- -- Host: localhost Database:
--------------------------------------------------------- -- Server version 4.0.12
-- -- Current Database: horde
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ horde;
USE horde;
-- -- Current Database: mysql
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ mysql;
USE mysql;
-- -- Current Database: test
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ test;
USE test;
If I start mysqldump --all-databases --opt from command line being user mysql, the output does contain tables and data:
-- MySQL dump 9.07
-- -- Host: localhost Database:
--------------------------------------------------------- -- Server version 4.0.12
-- -- Current Database: horde
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ horde;
USE horde;
-- -- Table structure for table 'horde_categories'
--
DROP TABLE IF EXISTS horde_categories; CREATE TABLE horde_categories ( category_id int(11) NOT NULL default '0', group_uid varchar(255) NOT NULL default '', user_uid varchar(255) NOT NULL default '', category_name varchar(255) NOT NULL default '', category_parents varchar(255) NOT NULL default '', category_order int(11) default NULL, category_data text, category_serialized smallint(6) NOT NULL default '0', category_updated timestamp(14) NOT NULL, PRIMARY KEY (category_id), KEY category_category_name_idx (category_name), KEY category_group_idx (group_uid), KEY category_user_idx (user_uid), KEY category_serialized_idx (category_serialized) ) TYPE=MyISAM;
-- -- Dumping data for table 'horde_categories'
--
/*!40000 ALTER TABLE horde_categories DISABLE KEYS */; LOCK TABLES horde_categories WRITE; INSERT INTO horde_categories VALUES (4,'horde.shares.mnemo','be','be','',NULL,'a:3:{s:5:\"owner\";s:2:\"be\";s:4:\"name\";s:26:\"Bernhard Erdmann\'s Notepad\";s:4:\"perm\";a:1:{s:5:\"users\";a:1:{s:2:\"be\";i:30;}}}',15,20030519213347),(5,'horde.shares.kronolith','be','be','',NULL,'a:3:{s:5:\"owner\";s:2:\"be\";s:4:\"name\";s:26:\"Bernhard Erdmanns Kalender\";s:4:\"perm\";a:1:{s:5:\"users\";a:1:{s:2:\"be\";i:30;}}}',15,20030519213354),(6,'horde.shares.nag','be','be','',NULL,'a:3:{s:5:\"owner\";s:2:\"be\";s:4:\"name\";s:28:\"Bernhard Erdmann\'s Task List\";s:4:\"perm\";a:1:{s:5:\"users\";a:1:{s:2:\"be\";i:30;}}}',15,20030519213400),(




