MySQL dump does not dump data

Posted on 2009-04-10
Last Modified: 2012-05-06
When using the mysql dump, the resulting sql files do not contain any of the data.  The database itself is at least 15MB, but the dump files are 4kb.  Is there an easy way to dump the ENTIRE thing?

Larger question: are there any recommendations for MySQL backup to Amazon S3?
Question by:ti57
  • 3
  • 2

Expert Comment

ID: 24119229
Sounds like you only dumps the structure and not the data?!

Try using phpmyadmin and dump structure and data

Author Comment

ID: 24119705
Need an automated solution

Expert Comment

ID: 24120112
ok, well phpmyadmin sqlcode goes like this:

-- Struktur-dump for tabellen `qsd_user`

CREATE TABLE `qsd_user` (
  `UserID` int(11) NOT NULL auto_increment,
  `UserName` text NOT NULL,
  UNIQUE KEY `UserID` (`UserID`)

-- Data dump for tabellen `qsd_user`

INSERT INTO `qsd_user` (`UserID`, `UserUser`) VALUES (1, 'Smith');
INSERT INTO `qsd_user` (`UserID`, `UserUser`) VALUES (2, 'Walter');
INSERT INTO `qsd_user` (`UserID`, `UserUser`) VALUES (3, 'John');

so it seems like you need to select * from table_name and then parse INSERT lines in you dumpfile
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.


Expert Comment

ID: 24120123
The UserUser in the INSERT lines is ofcourse UserName instead

Author Comment

ID: 24120500
Looking for a scriptable mysql dump solution...not sure what to do with myphpadmin code above...
LVL 21

Accepted Solution

theGhost_k8 earned 500 total points
ID: 24121013
use a shell script with a mysqldump command and put that in cron.
You also may zip the data if its consuming too much space.
You also may use rsync / sftp to move it to other backup machine.

Enter following line in:

mysqldump -uROOT -pPASSWORD --databases DATABASE-NAME(S) > DB-DUMP_`date +%d_%m_%y`
gzip DB-DUMP_`date +%d_%m_%y`


Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL Error 3 43
Multilanguage Database Design in MySQL 5 116
insert into database through form with dynamic fields. 2 31
SELECT query on two levels (detail and summary) 13 50
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (  It addresses one of the most common problems that plague beginning PHP develop…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question