Overview Managing Laravel Vapor databases requires more than just checking a UI; developers need direct access to data for debugging and local development. This tutorial breaks down the technical workflow for bridging the gap between your local environment and cloud-hosted MySQL instances. Whether your database is exposed to the public internet or tucked behind a private VPC, the connection strategy changes significantly to maintain security without sacrificing accessibility. Prerequisites Before attempting these connections, ensure you have the following: * A Laravel Vapor account with an active database. * TablePlus or a similar database management tool installed locally. * Basic familiarity with SSH keys and terminal commands. * An existing Network configured within the Vapor UI. Key Libraries & Tools * **Laravel Vapor**: The serverless deployment platform for Laravel. * **TablePlus**: A modern, native tool for managing multiple databases like MySQL and PostgreSQL. * **Jump Box**: A small, low-cost server acting as a secure gateway into a private network. Connecting to Public Databases Public databases are the simplest to configure because they allow direct traffic. Within the Vapor UI, navigate to your database card to retrieve the **Host**, **User** (defaulting to `vapor`), and **Password**. ```javascript // Connection Parameters for TablePlus { "engine": "MySQL", "name": "My Public DB", "host": "your-db-instance.aws.com", "user": "vapor", "port": 3306 } ``` Simply input these credentials into TablePlus. Always test the connection to confirm the firewall rules in AWS permit your local IP. The Jump Box Strategy for Private Databases Private databases live inside a network that refuses direct outside connections. To bypass this, we use a **Jump Box**. This instance sits inside your VPC and acts as an intermediary. First, create the jump box in the Vapor UI under **Resources > Networks**. Vapor generates a private SSH key; save this strictly on your local machine. In TablePlus, switch the connection type to **MySQL over SSH**. You must provide both the database credentials and the jump box SSH details (Server IP and the private key path). Syntax Notes & Best Practices * **Host Resolution**: Never hardcode these hosts; always pull them from the Vapor UI as they can change during migrations. * **User Defaults**: Vapor creates a master user named `vapor` by default, but you should create restricted users for production environments. * **SSH Security**: Keep your jump box keys out of version control. Treat them with the same sensitivity as your root passwords. Tips & Gotchas If a connection fails, check your VPC security groups. A common mistake is failing to place the jump box and the database in the **same network**. Without shared network proximity, the jump box cannot see the database, rendering the SSH tunnel useless. For private databases, ensure you are connecting to the database name `vapor` to see your tables immediately after connecting.
Jump Box
Products
Feb 2021 • 1 videos
High activity month for Jump Box. Laravel among the most active voices, with 1 videos across 1 sources.
Feb 2021
- Feb 25, 2021