Prerequisites: if you have the ssh logon permission, follow these steps: download the software putty and set the ssh logon option to log on to your home page. * (access via ftp) run the mysqldump command to execute database backup, the mysqlrestore command restores the database. Format: pXXXXXXX @ kundenserver :~ Mysqldump-hdbXX.puretec.de-
Prerequisites: if you have the ssh logon permission, follow these steps: download the software putty and set the ssh logon option to log on to your home page. * (access via ftp) run the mysqldump command to execute database backup, the mysqlrestore command restores the database. Format: pXXXXXXX @ kundenserver :~ Mysqldump -hdbXX.puretec.de-
Prerequisites: You have the ssh logon permission.
Work steps:
- Download the software putty and set the ssh Login Option
- After logging in, go to your home page Directory * (accessible through ftp)
- Execute the mysqldump command to execute database backup, and the mysqlrestore command to restore the database.
Format:
PXXXXXXX @ kundenserver :~ > Mysqldump -hdbXX.puretec.de-upXXXXXXX-p ******** dbXXXXXXX> dbXXXXXXXX. SQL
PXXXXXXX @ kundenserver :~ > Mysql -hdbXX.puretec.de-upXXXXXXX-p ********* dbXXXXXXX <dbXXXXXXXX. SQL
- After mysqldump is executed, a backup file is generated in the current directory (the size is the same as the database size)
- You can download the backup database file package through ftp.
- Restoring the database is opposite to the above two
You can also write a php script to complete the above operations:
Backup File
Include "../config. php ";
MYSQL_CONNECT ($ dbhost, $ dbuser, $ dbpw) or die ("unable to access database ");
MYSQL_SELECT_DB ($ dbname) or die ("the database has not been created ");
$ Path = getenv ('document _ root'). "/DB_backup ";
$ Result = MYSQL_QUERY ("show tables ");
$ Numrow = MYSQL_NUM_ROWS ($ result );
For ($ I = 0; $ I <$ numrow; $ I ++ ){
$ Table = MYSQL_RESULT ($ result, $ I );
Echo "$ table ...";
System (sprintf ("mysqldump -- opt-h $ dbhost-u $ dbuser-p $ dbpw $ dbname $ table | gzip> % s/$table. SQL .gz", $ path ));
Echo "DONE \ n ";
}
MYSQL_CLOSE ();
Restore Files
Include "../config. php ";
System (sprintf (
'Gunzip-c % s/dump. SQL .gz | mysql-h % s-u % s-p % s % s ',
Getenv ('document _ root '),
$ Dbhost,
$ Dbuser,
$ Dbpw,
$ Dbname
));
Echo '+ done ';
498) this. width = 498; 'onmousewheel = 'javascript: return big (this) 'alt = Attachment src = "/files/uploadimg/20051017/1734100 .jpg" border = 0>