This guide will help you set up a PlanetScale database for your Campus Bridge LMS application, which is required for deployment on Render.
- A GitHub account (for connecting to Render later)
- A Gmail or Google account (for PlanetScale signup)
- Go to https://planetscale.com
- Click "Start for free" or "Get started"
- Sign up using your Google account or email
- Verify your email address if prompted
- After logging in to PlanetScale, click "Create a database"
- Fill in the form:
- Database name:
campus-bridge-lms(or any name you prefer) - Region: Choose the region closest to your users (e.g., AWS us-east-1 for East Coast US)
- Database name:
- Click "Create database"
- After your database is created, you'll be taken to the database dashboard
- Click on the "Connect" button at the top
- Select "MySQL" as the connection method
- You'll see the connection details:
- Hostname: This is your MYSQL_HOST
- Username: This is your MYSQL_USER
- Password: Click "New password" to generate a password - this is your MYSQL_PASSWORD
- Database name: This is your MYSQL_DATABASE (should match your database name)
Save these credentials in a secure location as you'll need them for Render deployment:
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DATABASE
You can test the connection using the command line:
mysql -h [HOST] -u [USERNAME] -p[PLAINTEXT_PASSWORD] [DATABASE_NAME]-
Password Security: PlanetScale passwords are only shown once for security. If you lose it, you'll need to generate a new one.
-
Connection Limits: The free tier has some limitations which should be sufficient for development and small production loads.
-
SSL Connection: PlanetScale requires SSL connections, which is automatically handled by our application code.
After setting up PlanetScale:
- Proceed with Render deployment
- Use the PlanetScale credentials as your environment variables in Render:
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DATABASE
- Ensure you're using the "connect" credentials, not the internal ones
- Check that you've created a password for your user
- Verify the region is correct
- Double-check your username and password
- Generate a new password if needed
- Ensure your database name is correct
- Our application code already handles SSL connections to PlanetScale
- No additional configuration needed
If you encounter any issues:
- Check the PlanetScale documentation: https://docs.planetscale.com
- Visit the PlanetScale Discord community: https://discord.gg/planetscale
- Contact PlanetScale support through the dashboard