Search
 
SCRIPT & CODE EXAMPLE
 

PHP

can i back up mysql database from php code?

<?php
   $dbhost = 'localhost:3036';
   $dbuser = 'root';
   $dbpass = 'rootpassword';
   
   $backup_file = $dbname . date("Y-m-d-H-i-s") . '.gz';
   $command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass ". "test_db | gzip > $backup_file";
   
   system($command);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: change apply coupon text woocommerce 
Php :: using custom fonts in php 
Php :: php 2 decimal even if not exists 
Php :: withcookie function in php 
Php :: php for loop stack overflow 
Php :: month php written out 
Php :: laravel remove controller 
Php :: drupal get route current content type 
Php :: curl failed laravel centos 
Php :: delete a migration laravel 
Php :: php variable 
Php :: return single row from eloquent all collection laravel 
Php :: Print array to a file 
Php :: use external variable in php function 
Php :: laravel 6 use username on url 
Php :: cases_sensitive 
Php :: crud operations in php 
Php :: laravel all 
Php :: multiline string php 
Php :: how to make primary key and foreign key in phpmyadmin 
Php :: laravel enable query log 
Php :: php email sender 
Php :: laravel, if -get() array is not emtpy 
Php :: move wordpress to new server 
Php :: php best crud generator 
Php :: php Constant expression contains invalid operations 
Php :: laravel available router methods 
Php :: laravel gate 
Php :: how to give points to referrer in laravel 
Php :: merge multiple exceptions php 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =