PHP uses the mysqldump command to export the database, phpmysqldump. PHP uses the mysqldump command to export the database. phpmysqldumpPHP uses external commands to export the database. the code is very simple, so there is no need to talk about it. the php $ dumpFileName directory must have the write permission $ DbH PHP uses the mysqldump command to export
PHP uses external commands to export the database. the code is very simple, so there is not much nonsense.
<? Php // $ dumpFileName directory must have the write permission $ DbHost = 'localhost'; $ DbUser = 'root'; $ DbPwd = '000000'; $ DbName = 'a '; $ fileName = $ DbName. '_ MySQL_data_backup _'. date ('ymdhis ). '. SQL '; $ dumpFileName = "/var/$ fileName"; header ("Content-Disposition: attachment; filename = ". $ fileName); header ("Content-type: application/octet-stream"); header ("Pragma: no-cache"); header ("Expires: 0 "); echo 'mysqldump-h $ DbHost-u $ DbUser-p $ DbPwd $ DbName> $ dumpFileName '; $ hd = fopen ($ dumpFileName, 'RB'); echo fread ($ hd, filesize ($ dumpFileName )); fclose ($ hd);?>
The above is all the content described in this article. I hope you will like it.
Export PHP uses external commands to export the database. the code is very simple, so there is little talk about it. php // $ dumpFileName directory must have the write permission $ DbH...