I am trying to export only some tables in a local database, into a remote database which has the same name of these tables + some other tables (I want to overwrite the remote database tables which has the same name with the local ones I have from my database, both databases are called wordpress
).
After a bit of Google'ing, I thought the following command should work:
mysqldump -u USER --single-transaction --compress --order-by-primary --databases wordpress wp_posts wp_postmeta wp_comments wp_commentmeta wp_users wp_usermeta -pPASSWORD1 | mysql -u USER -pPASSWORD2 --port=REMOTE_PORT --host=REMOTE_HOST
But it gives me following error:
mysqldump: Got error: 1049: Unknown database 'wp_posts' when selecting the database
Why?