|
Search |
Vaatimukset:
Saattaa olla tarpeellista lisätä seuraava lause varmuuskopion ensimmäiselle riville: use name_of_database; database = tietokannan nimi johon ollaan kantaa tuomassa. Kirjaudu palvelimelle ja mene haluamaasi hakemistoon. Anna seuraavat komennot: cat name_of_the_base.sql | mysql --host=server_sql --user=name_of_the_base --password=password name_of_the_base Esim: cat testbackup.sql | mysql --host=sql3 --user=testimport --password=RtPgDsmL testimport Korvaa seuraavasti: - name_of_the_base.sql tiedostonimi - server_sql palvelin jolla SQL sijaitsee - name_of_the_base tietokannan nimi - password tietokannan salasana
echo "Your base restoration is in progress....... "; system("cat name_of_the_base.sql | mysql --host=server_sql --user=name_of_the_base --password=password name_of_the_base"); echo "End.Your base is on your hosting."; ?>
#!/usr/bin/perl print "Your base restoration is in progress....... "; system("cat name_of_the_base.sql | mysql --host=server_sql --user=name_of_the_base --password=password name_of_the_base"); print "End.Your base is on your hosting."; Lataaa skripti ja kannan varmuuskopio webhotellin www-hakemistoon. Skriptin ajo onnistuu linkistä: http://yourdomain.com/script_path/importbase.php Huom: Jos varmuuskopio on .sql.gz-päätteinen lisää seuraava komento skriptin ensimmäiseksi riviksi: system("gunzip base_name.sql.gz"); Esimerkki: PHP:llä: echo "unzip file..... "; system("gunzip testbackup.sql.gz"); echo "Your base restoration is in progress...... "; system("cat testbackup.sql | mysql --host=sql3 --user=testimport --password=RtPgDsmL testimport"); echo "End.Your base is on your hosting."; ?> Perlillä: #!/usr/bin/perl print "Unzip file..... "; system("gunzip testbackup.sql.gz"); print "Your base restoration is in progress....... "; system("cat testbackup.sql | mysql --host=sql3 --user=testimport --password=RtPgDsmL testimport"); print "End.Your base is on your hosting."; |