Skip to content
Mr-Jute

Mr-Jute

SHARE YOUR IDEAS

  • Magento
    • Magento 2.x
      • Magento 2.3
      • Magento 2.x Installation
      • Magento2.x Data Migration
      • Magento 2
        • Magento2.2
          • Magento 2 Installation
    • Magento performance
    • Magento Database
    • Magento basic
    • Magento Admin
  • Others
    • CSS
    • Knockout js
    • SEO
    • WordPress
    • Git
    • Jquery
    • Knockout js
    • Node/Dnode – Js
  • Contact

Tag: How to Access Magento Cloud (projects) Databases in your local Machine by Terminal

How to Access Magento Cloud (projects) Databases in your local Machine by Terminal



Below steps will help you to access the magento cloud Database in your local machine with basic magento terminal commands.

Install magento Cloud CLI:

  1. Open terminal and Go to >cd /var/www/
  2. Install magento cloud by following command,
    >var/www>curl -sS https://accounts.magento.cloud/cli/installer | php
  3. Add CLI to basefile,
    >var/www>export PATH=$PATH:$HOME/.magento-cloud/bin
  4. Update base profile
    >var/www>~/.bash_profile
  5. Go to >var/www>magento-cloud
    Once you execute “magento-cloud” command, system will show below message in your terminal,
    [root@localhost www]# magento-cloud
    Welcome to Magento Cloud!
    Loading projects…
    LoginRequiredException]
    Authentication is required.
    Please log in by running:
    magento-cloud login
    To log in using an API token, run: magento-cloud auth:api-token-login
  6. To resolve this issue, you have to generate token from your cloud account.
  7. API Token Generation, login https://accounts.magento.cloud/ go to Account Settings > API Token > Create an API token.

Way : 1 By Browser. Once you execute below command, system will provide URL. Using that URL (UI page) you can login.
var/www>magento-cloud login

Way : 2 Login vai Terminal:
>var/www>magento-cloud auth:api-token-login

Sample Screen:
Please enter an API token:
>

The API token is valid.
You are logged in.

Generating SSH certificate...
A new SSH certificate has been generated.
It will be automatically refreshed when necessary.
Do you want to create an SSH configuration file automatically? [Y/n] y
Configuration file created successfully: /root/.ssh/config

Username: <Cloud Account UserName>
Email address: <Cloud Account EmailID>
  1. Now your system is ready to login with “magento-cloud” command.
    var/www>magento-cloud
    Now system will list out all your cloud project (mapped with your cloud account).
  2. var/www>magento-cloud db:sql
    With this command system will list out all your cloud project databases. Select your project Database & environment which you want to access.

Ex:
Enter a number to choose a project:
Enter a number to choose an environment:

  1. Select Environment & start use/run your mysql query.

Note: magento-cloud list –> This command is list out all CLI sub command.
Access Magento Cloud Project Database in your local Machine (Terminal), Cloud CLI command Magento,Cloud CLI command Magento2, Login cloud database in terminal,
login magento cloud database in our local machine, CLI command magento2, CLI command login DB

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

Wear Mask and Maintain Social Distancing !!!



Author JutePosted on September 17, 2021Categories Magento 2, Magento basic, Magento DatabaseTags Access cloud database, access magento products by magento cloud command, How to Access Magento Cloud (projects) Databases in your local Machine by Terminal, how to access magento cloud DB, magento-cloud auth:api-token-login, magento-cloud auth:api-token-login generate keyLeave a comment on How to Access Magento Cloud (projects) Databases in your local Machine by Terminal

Recent Posts

  • 2023
  • PHPMetric
  • PHPLOC TOOL
  • இனிய சுதந்திர தின நல்வாழ்த்துக்கள்
  • Solution for : Magento 2 js-translation.json not generated | Magento2 admin dashboard keep on loading
  • Solution for Uncaught Error: Class ‘Locale’ not found in vendor/magento/framework/Locale/Bundle/DataBundle.php:64 in magento
  • Happy New Year

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
  • Magento
    • Magento 2.x
      • Magento 2.3
      • Magento 2.x Installation
      • Magento2.x Data Migration
      • Magento 2
        • Magento2.2
          • Magento 2 Installation
    • Magento performance
    • Magento Database
    • Magento basic
    • Magento Admin
  • Others
    • CSS
    • Knockout js
    • SEO
    • WordPress
    • Git
    • Jquery
    • Knockout js
    • Node/Dnode – Js
  • Contact
Mr-Jute Proudly powered by WordPress