> ## Documentation Index
> Fetch the complete documentation index at: https://shivamgoyal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Database

> Learn how to create and configure databases in CodeNull

# Creating a Database

CodeNull makes it easy to create and configure databases for your web application without writing complex setup code. This guide walks you through the process of creating different types of databases within the platform.

## Database Creation Process

<Steps>
  <Step title="Access the Database Dashboard">
    From your project dashboard, navigate to the Database section in the main navigation panel.
  </Step>

  <Step title="Create a New Database">
    Click the "Create Database" button in the top-right corner of the Database Dashboard.
  </Step>

  <Step title="Select Database Type">
    Choose the type of database that best suits your application needs:

    * **MongoDB**: Flexible document database (recommended for most projects)
    * **PostgreSQL**: Advanced relational database
    * **MySQL**: Popular SQL database
    * **Import from Excel/CSV**: Create a database from existing spreadsheet data
  </Step>

  <Step title="Configure Settings">
    Enter basic configuration for your database:

    * **Database Name**: A unique identifier for your database
    * **Description**: Optional information about the database purpose
    * **Environment**: Development, Staging, or Production
    * **Advanced Settings**: Performance and security options
  </Step>
</Steps>

## Database Connection Settings

Each database type has specific connection settings that you can configure:

<Tabs>
  <Tab title="MongoDB">
    <Frame>
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/shivamgoyal/images/mongodb-connection-settings.png" alt="MongoDB Connection Settings" />
    </Frame>

    **Configuration Options:**

    * Connection method (Direct Connect or Connection String)
    * Authentication method
    * Network access rules
    * Maximum connections
    * Timeout settings
  </Tab>

  <Tab title="PostgreSQL">
    <Frame>
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/shivamgoyal/images/postgresql-connection-settings.png" alt="PostgreSQL Connection Settings" />
    </Frame>

    **Configuration Options:**

    * Host information
    * Port settings
    * SSL configuration
    * Connection pooling
    * Schema preferences
  </Tab>

  <Tab title="MySQL">
    <Frame>
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/shivamgoyal/images/mysql-connection-settings.png" alt="MySQL Connection Settings" />
    </Frame>

    **Configuration Options:**

    * Server connection details
    * Authentication credentials
    * Character set and collation
    * Buffer settings
    * Query timeout values
  </Tab>
</Tabs>

## Creating a MongoDB Database

MongoDB is the recommended database type for most CodeNull projects. Here's how to create one:

<Steps>
  <Step title="Select MongoDB">
    From the database type options, select "MongoDB".
  </Step>

  <Step title="Basic Settings">
    Enter:

    * **Database Name**: (e.g., "my-project-db")
    * **Description**: "Main database for my project"
    * **Environment**: Development (for initial setup)
  </Step>

  <Step title="Connection Settings">
    Choose from:

    * **Managed Database**: CodeNull creates and manages the database (recommended)
    * **External Connection**: Connect to an existing MongoDB instance

    For managed databases, you only need to select your preferred region.
  </Step>

  <Step title="Security Settings">
    Configure:

    * **Authentication Method**: Username/Password or Certificate
    * **IP Access Rules**: Restrict access to specific IP addresses
    * **Encryption Settings**: Enable/disable encryption at rest
  </Step>

  <Step title="Finalize Creation">
    Click "Create Database" to provision your MongoDB instance.
  </Step>
</Steps>

<Note>
  When creating a managed MongoDB database, CodeNull automatically configures optimal settings based on your project size and expected usage patterns.
</Note>

## Importing from Excel/CSV

To create a database from existing spreadsheet data:

<Steps>
  <Step title="Select Import Option">
    Choose "Import from Excel/CSV" as your database type.
  </Step>

  <Step title="Upload File">
    Drag and drop your Excel file or CSV into the upload area.
  </Step>

  <Step title="Configure Import">
    Map your spreadsheet:

    * **Header Row**: Identify column headers
    * **Data Types**: Confirm or change detected data types
    * **Collection/Table Name**: Name for the imported data
    * **Primary Key**: Select a column as unique identifier
  </Step>

  <Step title="Review Schema">
    Review the detected schema and make any necessary adjustments.
  </Step>

  <Step title="Complete Import">
    Click "Create Database from Import" to finalize.
  </Step>
</Steps>

## Best Practices

<Tip>
  Start with a MongoDB database for most projects, as its flexible schema allows for easier changes as your application evolves.
</Tip>

* **Choose descriptive names**: Use clear, standardized naming for your databases
* **Create separate development environments**: Keep development and production databases separate
* **Document your database purpose**: Add detailed descriptions to help team members
* **Consider future scaling**: Select options that allow for growth
* **Secure from the start**: Configure proper authentication and access controls early

## Next Steps

After creating your database, you can:

* [Design your database schema](/database-dashboard/schema-design)
* [Add initial data to your database](/database-dashboard/add-data)
* [Set up data migration processes](/database-dashboard/data-migration)
