Backup – restore large mysql databases from shell
Posted on December 27th, 2010 in programming, web | Comments Off
Had to copy a large DB into a new one…Since MySQL Administrator and PHPMyAdmin failed to backup the 3.7Gb Database I was forced to do it from Shell like this:
mysqldump -u user -p db-name > output_file.out /*- launch this from the shell as root with the credentials of the source DB*/ mysql -u user -p new_db-name < output_file.out /* - this will copy from the dump file into the new database. you can also download the resulting file and use it on another server - you could do this the old fashion way by copying it on your local machine and then upload it to your new server and launch the previous command or if you have "scp":*/ scp output_file.out user@remote_ftp_path