export database to sql dump in php

Solutions on MaxInterview for export database to sql dump in php by the best coders in the world

showing results for - "export database to sql dump in php"
Lilas
21 Jul 2020
1<?php
2$dbhost = 'localhost';
3$dbuser = 'root';
4$dbpass = 'password';
5$dbname = 'test';
6$mysqldump=exec('which mysqldump');
7
8
9$command = "$mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname > $dbname.sql";
10
11exec($command);
12?>
13
Nevaeh
30 Aug 2019
1exec('C:\\wamp\\bin\\mysql\\mysql5.6.17\\bin\\mysqldump.exe -uroot DatabaseName> c:\\database_backup.sql');
2