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

# Add MySQL connection

> Create a new MySQL database connection.



## OpenAPI

````yaml https://api.camelai.com/api/schema/ post /api/v1/sources/add/mysql/
openapi: 3.0.3
info:
  title: camelAI API
  version: 1.0.0 (v1)
  description: API for camelAI - AI-powered data analytics platform
servers:
  - url: https://api.camelai.com
    description: camelAI API server
security: []
paths:
  /api/v1/sources/add/mysql/:
    post:
      tags:
        - sources
      summary: Add MySQL connection
      description: Create a new MySQL database connection.
      operationId: sources_add_mysql_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MySQLConnectionRequest'
            examples:
              MySQL:
                value:
                  type: mysql
                  hostname: localhost
                  port: 3306
                  username: root
                  password: password
                  database_name: mydb
                summary: MySQL database connection
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: The ID of the created connection
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  errors:
                    type: object
                    description: Field-specific validation errors
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MySQLConnectionRequest:
      type: object
      description: Serializer for MySQL connection configuration.
      properties:
        type:
          type: string
          minLength: 1
          description: Connection type identifier. Must be `MYSQL`
        account_name:
          type: string
          minLength: 1
          default: MySQL
          description: Display name for the connection
        hostname:
          type: string
          minLength: 1
          description: MySQL server hostname or IP address
          maxLength: 255
        port:
          type: integer
          default: 3306
          description: Port number
        username:
          type: string
          minLength: 1
          description: Database username
          maxLength: 255
        password:
          type: string
          writeOnly: true
          minLength: 1
          description: Database password
        database_name:
          type: string
          minLength: 1
          description: Database name
          maxLength: 255
      required:
        - database_name
        - hostname
        - password
        - type
        - username
      title: MySQL
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer scheme

````