0

I have a DB server and it has a table of 90 GB. Now I want to take a back up of that table. But DB is almost full and I cannot take back up into the same server.

Is there any way of taking backup using mysqldump -u username -ppassword dbname tablename > different_server_location

I used to do it on same server these days.

example:

mysqldump -u username -ppassword dbname tablename > /tmp/file_name

Since there is NO space available on DB server, how can I take backup of a table which is 90 GB!

and can I take backup of a file in few pieces. I mean 10 GB at once and so on ?

f_puras
  • 2,521
  • 4
  • 33
  • 38
Manojkumar
  • 1,351
  • 5
  • 35
  • 63
  • 2
    If the path to which you write the dumpfile is on another partition/disk (e.g. a network mount), then you will not be limited by the space remaining on the partition in which MySQL's data files are stored. – eggyal Oct 14 '12 at 09:23
  • @eggyal : Yes, I want to write the dumpfile on another location. I mean on different server. In short, I want to take back up of DB to staging server. Is it possible ? – Manojkumar Oct 14 '12 at 10:34
  • Yes... *if the path to which you write the dumpfile...*. Ugh, I'm just repeating myself. Alternatively, if MySQL is accessible from the remote host, you could run mysqldump from there. – eggyal Oct 14 '12 at 10:35
  • more details: `mysqldump -u username -ppassword dbname tablename > username@stagingserver_name:/tmp/sqlfile_name`. But this is not resulting – Manojkumar Oct 14 '12 at 10:37
  • Suggest you `mount` that remote path somewhere in your filesystem first. This question is moving off-topic for SO; perhaps ask on [su] if you're not sure how to proceed. – eggyal Oct 14 '12 at 10:40

1 Answers1

1

Why don't you dump from another server in same network like:

mysqldump --host=myserver -u backup mydb > test.sql
Nesim Razon
  • 9,684
  • 3
  • 36
  • 48