تستطيع تعديل الملف الذي أنزلته أنت ليعمل الحفظ بدل عملية الأرجاع أي تجعل عمله عكسي وأليك هذا الملف للحفظ في حالة رغبتك بشيء جاهز وتذكر تغيير القيم الصحيحة بالنسبة لك.
كود PHP:
<?php
set_time_limit(500);
// $dumpfile should be world writable "eg ... chmod 777 dump.sql".
// Configure this stuff
$dbhost = 'localhost'; // Mysql server name
$dbname = 'account_dbname'; // The name of your database
$dbuser = 'account_username'; // Your DB username
$dbpass = 'password'; // Your DB password
$dumpfile = 'dump.sql'; // The name of the dumpfile
// End configuration
`mysqldump --opt -u$dbuser -p$dbpass -h$dbhost $dbname > $dumpfile`;
echo "OK, hopefully your database ($dbname) has been backed up! Try to download $dumpfile";
?>
وأيضاً اليك هذا الملف في حالة رغبتك أسترجاع قاعدة بيانات ضخمة الحجم عن طريق المستعرض:
كود PHP:
<?php
set_time_limit(500);
// Configure this stuff
$dbhost = 'localhost'; // Mysql server name
$dbname = 'account_dbname'; // The name of your database
$dbuser = 'account_username'; // Your DB username
$dbpass = 'password'; // Your DB password
$bckfile = 'dump.sql'; // The name of the dumpfile
// End configuration
`mysql -u$dbuser -p$dbpass -h$dbhost $dbname < $bckfile`;
echo "OK, hopefully your database ($dbname) has been restored! Try checking $dbname using phpMyAdmin";
?>
محمــد