db-validate

Validate Laravel database configuration and test live connections.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mim1012/ykp_project --skill db-validate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-validate
Source: https://github.com/mim1012/ykp_project/tree/main/.claude/skills/db-validate
Command: npx skills add https://github.com/mim1012/ykp_project --skill db-validate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill quickly diagnoses and resolves common Laravel database connection issues, such as "connection refused," "access denied," or "database not found." It saves developers significant debugging time by pinpointing the exact cause of connectivity problems.

Core Features & Use Cases

  • .env & config Validation: Checks database-related environment variables in .env and the config/database.php file for consistency and correctness.
  • Live Connection Test: Attempts a real database connection using your current Laravel configuration and reports success or detailed error messages.
  • PostgreSQL Server Status: Verifies if your local PostgreSQL server is running and listening on the correct port, a common cause of connection failures.
  • Use Case: When your Laravel application throws a "Could not connect to database" error, this Skill will pinpoint whether it's a server issue, incorrect credentials in .env, a missing database, or a misconfigured session driver, and provide the exact commands to fix it.

Quick Start

My Laravel application is failing to connect to the database. Please use the db-validate skill to check the connection and suggest a fix.

Frequently Asked Questions about db-validate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a Laravel database connection error?

Database connection errors in Laravel typically stem from incorrect .env credentials, misconfigured config/database.php, or a stopped database server. Validate your environment variables, verify driver, host, database name, username, and password match your actual database setup, then test the connection with a live connection attempt to pinpoint the exact failure point.

How do I troubleshoot SQLSTATE[HY000] errors in Laravel?

SQLSTATE[HY000] errors indicate a general database connection failure. Check that your PostgreSQL server is running and listening on the configured port, verify .env database credentials are correct, ensure the database exists, and confirm config/database.php maps environment variables properly before attempting a live connection test.

Can I validate Laravel database configuration without running my application?

Yes, you can validate database configuration by checking .env values and config/database.php for consistency, verifying the database server is accessible on the correct host and port, and performing a live connection test via Laravel Tinker or DB::connection without deploying or running your full application.

Why is my Laravel application unable to connect to PostgreSQL?

Connection failures usually occur when PostgreSQL is not running, listens on a different port than configured, or credentials in .env are incorrect. Verify server status and port configuration, confirm .env values match your PostgreSQL setup, check that the database name exists, and test the live connection to identify the root cause.

What database connection issues does Laravel validation catch?

Laravel database validation detects connection refused errors, access denied failures, missing databases, incorrect credentials, misconfigured drivers, empty host arrays, and mismatches between .env and config/database.php, reporting structured diagnostics with specific remediation steps for each error type.

Do I need to restart my application to test database connectivity changes?

No, you can test database connectivity changes immediately using a live connection test without restarting your application. This allows you to validate .env edits, credential updates, or PostgreSQL configuration changes instantly and confirm the connection works before deploying or running your full Laravel app.