# Connection Details

> Find and use your database connection details to connect your application.

Connection Details
------------------

Once your managed database is running, you can find the connection details on the **Connection** tab of your database.

### Finding Your Connection Details

1. Navigate to **Databases** in the sidebar
2. Click on your database
3. Go to the **Connection** tab

You'll see the following information:

- **Host** - The hostname of your database server
- **Port** - The port number (3306 for MySQL, 5432 for PostgreSQL by default)
- **Default database** - The name of the default database (typically `defaultdb`)
- **Username** - Your primary database username
- **Password** - Click to reveal the primary password

### Connecting from a Laravel Application

Update your `.env` file with the connection details:

**MySQL:**
```
DB_CONNECTION=mysql
DB_HOST=your-database-host
DB_PORT=3306
DB_DATABASE=defaultdb
DB_USERNAME=your-username
DB_PASSWORD=your-password
```

**PostgreSQL:**
```
DB_CONNECTION=pgsql
DB_HOST=your-database-host
DB_PORT=5432
DB_DATABASE=defaultdb
DB_USERNAME=your-username
DB_PASSWORD=your-password
```

### Connecting from a Ploi Cloud Application

If your application is deployed on Ploi Cloud, add these values as environment variables in your application's settings. Your application will be able to reach the database over the network — no additional firewall rules are needed if you allow connections from the Ploi Cloud IP ranges.

### SSL Connections

All managed databases support SSL connections. SSL is recommended for production workloads to encrypt data in transit. Most database clients and ORMs support SSL by default when connecting to a remote host.

### Connection Limits

Each plan has a maximum number of concurrent connections. If your application needs more connections, consider:

- Using a connection pooler (like PgBouncer for PostgreSQL)
- Upgrading to a larger plan
- Optimizing your application to use fewer persistent connections

### Troubleshooting

**"Connection refused" errors:**
- Verify the host, port, username, and password are correct
- Check that your IP address is allowed in the [IP access control](/documentation/managed-databases/ip-filtering) settings
- Ensure the database status is "Running"

**"Too many connections" errors:**
- Check the connection limit for your plan
- Close idle connections in your application
- Consider upgrading to a larger plan

### Next Steps

- [Database users](/documentation/managed-databases/database-users) - Create additional users
- [IP filtering](/documentation/managed-databases/ip-filtering) - Restrict access by IP address
