Mysqldump-H the.***.139.** -U k**Eb-P K**Eb> /Www/Test/ .- --Geneva. sql; Enter Password://Enter your password to note:1. mysqldump is notA MySQL command, it isA command line utility. You must call it fromyour shell command line. Mysqldump is not a MySQL command, it is a command lines utility. You must invoke it from your shell command line. 2only when the data volume is small, when the big time need to write timed script run code backup3.-Uroot-Ppassword-U-p should be stuck with the username and password, there is no space between, so the recommended practice is not to enter the password4MySQL database password must not be empty, if the password is empty, then mysqldump can not be used
This can also be done with PHP code, only when the amount of data is small
<?Phpdate_default_timezone_set (' PRC ');$dbhost= ' 192.168.6.13:3036 ';$dbuser= ' Hanks ';$dbpass= ' 4763437 ';$dbname= ' Ksweb ';$date=Date("y-m-d");//Test//$command = "mysqldump--opt-h $dbhost-u $dbuser-P $dbpass $dbname | gzip > $backupFile ";$command= "Mysqldump-h 192.168.6.13-u hanks-p4763437 ksweb > '$date'. SQL ';system($command);Echo"Success";
Backing up data tables with mysqldump