MySQL-Datenbank sichern
bearbeitet von Jörg ReinholzMoin!
Möglicherweise geht auch:
~~~php
<?php
header('Content-Type: text/plain');
echo `mysqldump --host="db_server" --user="user_name" --ppassword="passwort" --databases="shop forum blog"`;
?>
~~~
Das dump landet dann im Browser, Du kannst es aber auch in eine Datei umleiten:
~~~php
<?php
header('Content-Type: text/html');
echo `mysqldump --host="db_server" --user="user_name" --password="passwort" --databases="shop forum blog" > export.txt`;
echo "Fertig. <a href='export.txt'>Download</a>.";
?>
~~~
Beachte die Backticks!
**[Mehr Optionen](https://dev.mysql.com/doc/refman/5.7/en/mysqldump-sql-format.html).**
Jörg Reinholz
MySQL-Datenbank sichern
bearbeitet von Jörg ReinholzMoin!
Möglicherweise geht auch:
~~~php
<?php
header('Content-Type: text/plain');
echo `mysqldump --host="db_server" --user="user_name" --ppassword="passwort" --databases="shop forum blog"`;
?>
~~~
Das dump landet dann im Browser, Du kannst es aber auch in eine Datei umleiten:
~~~php
<?php
header('Content-Type: text/html');
echo `mysqldump --host="db_server" --user="user_name" --password="passwort" --databases="shop forum blog" > export.txt`;
echo "Fertig. <a href='export.txt'>Download</a>."
?>
~~~
Beachte die Backticks!
**[Mehr Optionen](https://dev.mysql.com/doc/refman/5.7/en/mysqldump-sql-format.html).**
Jörg Reinholz