Solved

MySQL dump does not dump data

Posted on 2009-04-10
6
758 Views
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?
0
Comment
Question by:ti57
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:QualitySoftwareDevelopment
Comment Utility
Sounds like you only dumps the structure and not the data?!

Try using phpmyadmin and dump structure and data
0
 

Author Comment

by:ti57
Comment Utility
Need an automated solution
0
 
LVL 3

Expert Comment

by:QualitySoftwareDevelopment
Comment Utility
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`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- 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
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:QualitySoftwareDevelopment
Comment Utility
The UserUser in the INSERT lines is ofcourse UserName instead
0
 

Author Comment

by:ti57
Comment Utility
Looking for a scriptable mysql dump solution...not sure what to do with myphpadmin code above...
0
 
LVL 21

Accepted Solution

by:
theGhost_k8 earned 500 total points
Comment Utility
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: mysql-backup.sh

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

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now