Answer the question
In order to leave comments, you need to log in
What are the best options for creating a full database backup via console and PHP?
Hello, the task is to create a full backup of all databases for the user.
Is it possible to dump to PHP via PDO (for example, to maintain multiplatform)?
this is how the PHP code looks like with the console option
exec('mysqldump '
. '--user='.$value['username']
.' --password='.$value['password']
.' --host='.$value['host']
.' -A'
.' >'
.$backupDir
.'/'
.$key
.'-'.$value['host']
.'-'.$value['database']
.'.sql');
}
mysqldump -u root -h82.82.82.82 -p Pass -A > all-databases.sql
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question