Dump can execute functions similar to tar. However, dump tends to consider file systems rather than individual files. This article provides answers to some questions about the Linux mysql dump command.
1. Ensure that the directory for storing Linux mysql dump exists and the process has the write permission on the directory. The directory that stores Linux mysql dump, that is, the current directory of the process, which is generally the directory where the command was issued to start the process. However, if the script is started, the script may modify the current directory, and the current directory of the process will be different from the directory where the script was originally executed. In this case, you can view the target of the "/proc/<process pid>/cwd" symbolic link to determine the real current directory address of the process. You can also view the processes started by the system service in this way.
2. If the program calls seteuid ()/setegid () to change the valid user or group of the process, the system will not generate coredump for these processes by default. Many service programs call seteuid (), such as mysql. No matter which user you use to run mysqld_safe to start mysql, the effective user of mysqld is always the msyql user. If you run A program with user A, but the user who sees the program in ps is B, then these processes call seteuid. To generate coredump for these processes, you need to change the content of the/proc/sys/fs/suid_dumpable file to 1. The default value is 0)
3. This is generally known as setting a large enough core file size limit. The core file size generated when the program crashes is the memory size occupied by the program running. However, when a program crashes, the behavior cannot be estimated as usual. For example, errors such as buffer overflow may cause the stack to be destroyed. Therefore, the value of a variable is often changed to a mess, then the program uses this size to apply for memory, which may cause the program to occupy more memory than usual. Therefore, no matter how little memory is occupied during normal running of the program, make sure to generate the core file or set the size limit to unlimited.