Q:

Magento 2: How to dump database from Magento cloud

How to dump the database to local system from Magento Cloud server with Magento 2 Commerce.
I have only access to the ssh but that ssh user doesn't have write permission into the server. So by any how I need to download the database to the local system.
I have also tried to run the below command in my local system:

mysqldump -h hostname -u username -p dbname > dbname.sql

Hostname I used same as ssh host because I found 127.0.0.1 as db host on app/etc/env.php. But unfortunately it doesn't help.
I have checked this Magento 2 Commerce cloud database export but I dont know how to use this?
Is ece-tools db-dump already available in Magento cloud? Or we need to install it? If I need to install it then I cannot do this as there is no write permission is there in the server. I can only use git.
Is there any other way to do this Or How can I achieve this? 

A:

Install magento-cloud cli 

https://devdocs.magento.com/cloud/reference/cli-ref-topic.html

Get a project and environment with the magento-cloud cli
Run command to go into the current environment, dump the file, and then download it to your local computer

magento-cloud db:dump

