Here's the information I have:
I am working with a Linux based system using MySQL and PHP5. I need to be able to generate a mysqldump
from within a .php file, and then have that dump be stored in a file on the server in a location I would specify.
As I'm a PHP nooblet, I'd like someone to give me some assistance, guidance, or code, that would do what I require. This would have to be run remotely from the Internet.
None of the above codes worked for me. I am using windows. Below Code worked for me...
This will save file in your project folder according to your query whatever data you want. If you want to dump whole database or table then you can use this link http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/using-php-to-backup-mysql-databases.aspx
Well, you can always use PHP's system function call.
http://php.net/manual/en/function.system.php
http://www.php.net/manual/en/function.exec.php
That runs any command-line program from PHP.
Take a look here: https://github.com/ifsnop/mysqldump-php ! It is a native solution written in php.
You can install it using composer, and it is as easy as doing:
It supports advanced users, with lots of options copied from the original mysqldump.
All the options are explained at the github page, but more or less are auto-explicative: