Remotely Connecting to a Namecheap Database

From Littledamien Wiki
Revision as of 19:14, 15 February 2022 by Video8 (talk | contribs) (→‎DataGrip)
Jump to navigation Jump to search

DataGrip

Make a new connection

  • + ; to open the Data Sources and Drivers dialog, then + N for a new connection.
    • Or Select the Plus Sign icon at the top left of the app > Data Source > MariaDB.
    • SSH/SSL tab
      • Check Use SSH tunnel
      • Click the three dots button to the far right of the Use SSH tunnel line to create a new tunnel (or select from the drop down if one has already been created for this Namecheap hosting account.)
        • Click the plus sign at the top left of the SSH Configurations dialog to add a new configuration.
        • Host: IP or default URL for the Namecheap hosting account.
        • Port: SSH port assigned to the Namecheap hosting account.
        • User name: Admin user name for the Namecheap account, i.e. the account that has ssh access.
        • Authentication type: Key pair
        • Private key file: (path to a key file downloaded from cPanel)
          • cPanel > Security > SSH Access > Manage SSH keys > Public keys > (item named like id_rsa) > View/Download
          • Download the file and save it to ~/.ssh/. Makes sense to rename it to namecheap_rsa.pub so as to overwrite any existing id_rsa files.
        • Click the Test Connection button.
          • Ignore the passphrase prompt.
          • A 2nd prompt will appear asking for a password. Enter the ssh account password.
        • The SSH configuration can be saved if the test connection was successful.
    • General tab
      • Host: 127.0.0.1 (Don't use "localhost" here.)
      • Port: 3306
      • User: MariaDB user name with access to the web app's database
      • Password: MariaDB password
      • Database: The web app's MariaDB database name
      • Click the Test Connection button
        • Ignore the passphrase prompt.
        • The next dialog will prompt for a password. Enter the ssh account's password.
      • The data source is ready to be saved if the test connection succeeds.

Connecting to the existing data source

When first establishing a connection to the data source, DataGrip will prompt for a password on the status bar at the bottom right of the app. Enter passphrase and password as described above.

The connection will time out after some minutes go by. It will be necessary to enter the ssh password again after this happens. The prompt will show up at the bottom right of the DataGrip app.

How to remotely connect to a MySQL database located on our shared server - Namecheap Knowledgebase