Let’s say that I have database1 and database2.
database1 – contains data
database2 – is empty.
I want to copy all data from database1 to database2 via SSH – duplicate database1.
What command should I use?
I have tried
mysqldump -u user -p database1 > database1.sql
Enter password: mysqldump: Got error: 1045: Access denied for user 'user'@'localhost' (using password: NO) when trying to connect
This will copy database from S1 to S2
Unzip file
Next you’ll have to import on S2
enjoy