Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grabbing mysql dump file from remote server

Im working as an intern and am new to rails and it's production evn. I was wondering how I could grab a database dump from a remote server and import into my local database so that my local env mirrors that of the live version of a site. I have access to the database, and I have the current version of the code in my environment. I am missing the pictures and files attached to the site, and need it to make changes locally.

like image 536
vpoola88 Avatar asked Nov 17 '25 10:11

vpoola88


1 Answers

  1. In the production server execute the following command

    mysqldump -u username -ppassword db_name > production_dump.sql

  2. scp the production_dump.sql file to your local machine

  3. In your local machine execute the following command.

    mysql -u username -ppassword db_name < production_dump.sql

like image 153
usha Avatar answered Nov 19 '25 03:11

usha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!