Getting 0KB of size file while backup mysql database using mysql dump?

1.2k Views Asked by At

Notes: I tried all questions & answers related this topic. Additionally and I tried related questions and try to solve it but not success. So please read my question thoroughly.

Relative answer search

1. Getting 0KB of size file while backup mysql database using mysql dump

2. Using PHP script: why mysqldump does not dump sql file?

3. Mysql PHP backup database using mysqldump

I want to Full database mysql (store procedure + table + trigger ) i try to code then not get any error but 0 kb database Download

I connect Mysql CMD Got Error like this

MYSqldump:Got error:2003 : can't connect to Mysql Server '172.30.70.54' <10060> when trying to connect

Cmd Code Execute

mysqldump  --user=root --password= --host=172.30.70.54 dv-admin > db_backup5.sql 

enter image description here

Php Script

<?php
    $dbhost = '172.30.70.54';
    $dbuser = 'root';
    $dbpass = 'mypass';
    $dbname='mydb';
    $toDay = date('d-m-Y');
    shell_exec("mysqldump --opt --routines -h$dbhost -u$dbuser -p$dbpass --single-transaction $dbname  > db_backup.sql");
    system("mysqldump -opt -routines -h$dbhost -u$dbuser -p$dbpass -single-transaction $dbname  > db_backup2.sql");
    ?>
0

There are 0 best solutions below