Big MYSQL Database Dump

This is used for general discussion that is not necessarily server-related.
Post Reply
GT100
New to forums
New to forums
Posts: 3
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Aug 19, 2020 9:58 am

Big MYSQL Database Dump

Post by GT100 »

I was told to ask this question here by John.

I was using Putty to try and dump a 5gb MYSQL database to keep as a backup. I tried using:

mysqldump -p -u username database > SQLbackup.sql.zip

It works but the data was corrupted. I guess removing the .zip at the end would fix this?


I had one other question. The database has a lot of IPs, is there a command I can use to dump all the IPs into a .txt file? I want to whitelist them on my Firewall.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Big MYSQL Database Dump

Post by Edge100x »

It would output to a .sql file, so you should keep the extension .sql. If you want that to be a .zip, you could either pipe it through the zip utility, or run zip on it afterward.

In terms of dumping IP addresses, you would want to do that with a script that queries your database and then prints them out, either to STDOUT or a file. You could use PHP, Python, or Perl to do this, for instance.
Post Reply