mysqldump -u root -h localhost -pmypassword faqs | gzip -9 > faqs-db.sql.gz
This will create a gzipped file containing insert statements
To transfer the file to another computer
scp faqs-db.sql.gz root@my.other.host.com:/home/username/faqs-db.sql.gz
Create the database on the new sql you want to import to
mysql -uroot -p create faqs; exit
To import the file into a new mysql database named faqs
gunzip -c faqs-db.sql.gz | mysql -uroot -pmypassword faqs
No comments:
Post a Comment