Answers: <p>Yes, when your terminal closes the stdout file descriptor for that process closes as well and it does not have where to write.</p>
  <p>First thing which would make me nervous is that you do not store the output to a file, so you are NOT doing any backups. You have to store the backup somewhere.</p>
  <p>One way how to do it to redirect the output to a file: <code>mysqldump  &gt; backup_file_name.sql</code> - you will see not output on the terminal, but you will see the file growing until the backup is ready.</p>
  <p>You can also use programs like <code>screen</code> or <code>tmux</code> for &quot;keeping the term open&quot; for the program. When you connect back, you can re-attach your terminal to that output. But again - do not backup to screen. When you want to see the output while storing it also to a file you can use <code>tee</code>: <code>mysqldump | tee backup_file.sql</code> - it will split the output and write it both to terminal and to file.</p>
  <p>Writing to terminal is really slow and you should not do it anyway. If you backup an AWS RDS instance, it is already has some automatic backup and you can trigger manual ones via UI or programatically. If you backup mysql running on your instance and you backup it onto the same instance it is not a very good backup after all. You should then copy that file to s3 or somewhere.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-02-17T00:38:00.063Z
Answers: Actually, I dump directly to a DB, so I don't need to backup to a file and then restore a DB from that file: perhaps, that will be even slower than writing to terminal. But what is written in the terminal is just an info similar to this: `Dump progress: 0/1 tables, 281222750/435250801 rows`. And when it completes, it is just written that mysqlpump is completed. tee may be useful so thanks a lot.
Answers: Armine
Answers: CC BY-SA 4.0
Answers: 2022-02-16T22:35:47.197Z
Answers: 2022-02-16T22:35:47.197Z
Answers: petrchpetr
Body: <p>I am neither a DB administrator, nor a DevOps but I need to migrate a very large table (~500M rows) from one MySQL schema to another. For doing so, I use <code>mysqldump</code>backup tool. Also, since the DB is an AWS DB, I establish an SSH connection to the Ubuntu server from terminal and then run the command from command line.</p>
  <p>Everything works as needed and I can see the process being output on my terminal, but once my computer sleeps or I have an internet connection interruption, I am facing a problem: <code>client_loop: send disconnect: Broken pipe</code>.</p>
  <p>That's probably ok, but after reconnection to the Ubuntu server I don't see that process output on the terminal, nor I can see the corresponding process in the processes list.</p>
  <p>I don't know if that can be, but once my terminal looses the connection with the server mysqldump terminates on the server without completion.</p>
  <p>In order to be sure, I would like to know:</p>
  <ul>
  <li>if that can happen or no?</li>
  <li>Where mysqldump logs its process so I could take a look at the log file and see what happened?</li>
  </ul>
  
Comments: CC BY-SA 4.0
Comments: 2022-02-22T19:58:57.693Z
Comments: This is a better question for [dba.se]
Comments: Evan Carroll
Comments: CC BY-SA 4.0
Comments: 2022-02-22T20:31:25.417Z
Comments: The same question I have posted there too.
Comments: Armine
Tags: <amazon-web-services><linux><mysql><ubuntu>
Title: Where is located mysqldump log file on Linux/Ubuntu
UserDisplayName: Armine
ThreadText: # Where is located mysqldump log file on Linux/Ubuntu
  
  (Asked by: username_0 on 2022-02-16)
  
  I am neither a DB administrator, nor a DevOps but I need to migrate a very large table (~500M rows) from one MySQL schema to another. For doing so, I use `mysqldump`backup tool. Also, since the DB is an AWS DB, I establish an SSH connection to the Ubuntu server from terminal and then run the command from command line.
  
  Everything works as needed and I can see the process being output on my terminal, but once my computer sleeps or I have an internet connection interruption, I am facing a problem: `client_loop: send disconnect: Broken pipe`.
  
  That's probably ok, but after reconnection to the Ubuntu server I don't see that process output on the terminal, nor I can see the corresponding process in the processes list.
  
  I don't know if that can be, but once my terminal looses the connection with the server mysqldump terminates on the server without completion.
  
  In order to be sure, I would like to know:
  
  * if that can happen or no?
  * Where mysqldump logs its process so I could take a look at the log file and see what happened?
  
  **Tags:** amazon-web-services, linux, mysql, ubuntu
  
  > **Comments:**
  > **username_1**: This is a better question for [dba.se]  
  > **username_0**: The same question I have posted there too.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-02-16. Score: 0
  
  Yes, when your terminal closes the stdout file descriptor for that process closes as well and it does not have where to write.
  
  First thing which would make me nervous is that you do not store the output to a file, so you are NOT doing any backups. You have to store the backup somewhere.
  
  One way how to do it to redirect the output to a file: `mysqldump > backup_file_name.sql` - you will see not output on the terminal, but you will see the file growing until the backup is ready.
  
  You can also use programs like `screen` or `tmux` for "keeping the term open" for the program. When you connect back, you can re-attach your terminal to that output. But again - do not backup to screen. When you want to see the output while storing it also to a file you can use `tee`: `mysqldump | tee backup_file.sql` - it will split the output and write it both to terminal and to file.
  
  Writing to terminal is really slow and you should not do it anyway. If you backup an AWS RDS instance, it is already has some automatic backup and you can trigger manual ones via UI or programatically. If you backup mysql running on your instance and you backup it onto the same instance it is not a very good backup after all. You should then copy that file to s3 or somewhere.
  
  > **Comments:**
  > **username_0**: Actually, I dump directly to a DB, so I don't need to backup to a file and then restore a DB from that file: perhaps, that will be even slower than writing to terminal. But what is written in the terminal is just an info similar to this: `Dump progress: 0/1 tables, 281222750/435250801 rows`. And when it completes, it is just written that mysqlpump is completed. tee may be useful so thanks a lot.  
  
  ---
  
  