On Monday 31 March 2008 16:24:59 Marcos Vinícius Vieira dos Santos wrote:

> I have to export my databases and I get large files for my dump.
>
> How can I export compressed databases in MySQL?
>
> I use:  #mysqldump --default-character-set=latin1 -u'name_user' -p'pass' 
> 'database_name' > $path/file_name.sql;

If I understand what you're after correctly then this should do the trick for 
you:-

mysqldump --default-character-set=latin1 -u'name_user' -p'pass' 
 'database_name' | gzip -9 > $path/file_name.sql.gz

If you ever want to reimport the dumped data you can then do:-

gzip -dc $path/file_name.sql.gz | mysql -u'name_user' -p'pass' 
 'database_name'

-- 
Best regards,
 Rob Hall - Red Hat Certified Engineer
 Senior Systems Administrator 
 Newsquest Digital Media

 "To mess up a Linux box, you need to work at it; 
  to mess up your Windows box, you just have to work on it."

 "My software never has bugs. It just develops random features."

 "To err is human, but to really foul things up you need a computer."

--------------------------------------------------------------------
This email has been scanned for viruses and other threats  using Newsquest's 
Ironport email filters

This e-mail, including any attachment, is private and confidential. 
It should not be read, copied, disclosed or otherwise used by any person other 
than the intended recipient(s).  
If you have received this e-mail in error, please notify the sender 
immediately. 
Newsquest reserves the right to monitor e-mails in accordance with the 
Telecommunications (Lawful Business Practice) 
(Interception of Communications) Regulations 2000.
 
Newsquest Limited. 
Registered in England, number 3105111 .  Registered office: 58 Church Street, 
Weybridge, Surrey KT13 8DP
--------------------------------------------------------------------

Reply via email to