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

# Quickstart

> Get up and running with VillageSQL Server.

Get a VillageSQL Server instance running, connect to it, and try out the extension system.

## Step 1: Install VillageSQL

### Option A: Docker (Recommended)

Run VillageSQL in a container with no host-side installation:

```bash theme={null}
docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 villagesql/server:stable
```

### Option B: Shell Script

Install VillageSQL directly on your machine using the official installation script. It downloads and configures the server binary for your platform.

```bash theme={null}
curl https://villagesql.com/shell | sh
```

To inspect the script before running it: `curl https://villagesql.com/shell | less`

### Option C: Build from Source

For development or custom builds, follow the [Clone and Build from Source Guide](/docs/mysql-8.4/0.0.4/source) to compile from the latest code.

## Step 2: Connect to the Server

Once your server is running, connect using any standard MySQL client:

```bash theme={null}
mysql -u root -p
```

## Step 3: Install Your First Extension

VillageSQL ships with example extensions you can install immediately.

Install the `vsql_complex` extension to add support for complex numbers:

```sql theme={null}
INSTALL EXTENSION vsql_complex;
```

Verify installation:

```sql theme={null}
SELECT * FROM INFORMATION_SCHEMA.EXTENSIONS;
```

You should see `vsql_complex` listed.

For more details, see [Installing Extensions](/docs/mysql-8.4/0.0.4/install).

## Step 4: Use Extended Data Types

Now that the extension is active, you can use the `COMPLEX` data type in your tables just like native types.

```sql theme={null}
-- Create a database and use it
CREATE DATABASE demo;
USE demo;

-- Create a table using the new COMPLEX type
CREATE TABLE electronic_components (
    id INT PRIMARY KEY,
    name VARCHAR(50),
    impedance COMPLEX
);

-- Insert complex number values (using string literals)
INSERT INTO electronic_components VALUES
    (1, 'Resistor', '(100,0)'),
    (2, 'Inductor', '(0,50)'),
    (3, 'Capacitor', '(25,-75)');

-- Query the data
SELECT * FROM electronic_components;

-- Use extension functions
SELECT
    name,
    impedance,
    complex_abs(impedance) AS magnitude,
    complex_real(impedance) AS resistance,
    complex_imag(impedance) AS reactance
FROM electronic_components;
```

To uninstall an extension:

```sql theme={null}
UNINSTALL EXTENSION vsql_complex;
```

## Next Steps

Now that you have VillageSQL running and have verified the extension system, explore more:

<CardGroup cols={2}>
  <Card title="Managing Extensions" icon="puzzle-piece" href="/docs/mysql-8.4/0.0.4/managing">
    Learn how to install and manage other extensions.
  </Card>

  <Card title="Create an Extension" icon="code" href="/docs/mysql-8.4/0.0.4/create">
    Learn how to build your own extensions for VillageSQL.
  </Card>

  <Card title="Upgrade Guide" icon="arrow-up" href="/docs/guides/upgrade">
    Upgrading from a prior version or migrating from MySQL.
  </Card>
</CardGroup>

## Troubleshooting

### Server Won't Start

Common issues:

* Port 3306 already in use: configure your server to use a different port
* Permissions: Ensure files are readable/executable
