I am working on a project based on Magento Commerce Cloud.
Can anyone please guide me on how can I access the database of the staging branch?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
If your goal is to access it using some type of GUI client, you could accomplish this by opening an ssh tunnel using the
magento-cloud utility, similar to the above answer:
magento-cloud tunnel:open --project=<PROJECT_ID> --environment=staging
Then run the command
magento-cloud tunnel:info to get the appropriate credentials to input into whatever utility you may be trying to use.
[edited] syntax error on "tunnel:open"
I use dbeaver software. It gives you a visual editor
Once the tunnel is open (via the cli tool), any client should be able to connect through it.
magento-cloud tunnel:infowill give the connection information
Connect to MySQL server in Dbeaver
Create new connection button
In the ‘General’ window this is ‘User name’ and ‘Password’ for databse
User name: MYSQL user name you want to use
Password: Password of the MYSQL user
When you have already filled the required fields click to Next button. After it the second important window appears:
First of all click to the checkbox icon ‘Use SSH Tunnel’ to gain access to the settings. Fields you have to fill in the right way:
HOST/IP: IP of details shown by magento command
User Name: ssh connection user name you want to use as tunnel to MySQL connection
Authentication Method: ‘Public Key’
Private Key: Path of the private key on your PC
Password: ssh tunnel connection password
If everything has configured correctly when you click to ‘Test Connection’ a confirmation message box will appear.