# CMS Database

In CMS Full Form, the **CMS database** is where all the data for your website is stored, including languages, posttype, terms, users, settings, and other options. CMS Full Form typically uses **MySQL** or **MariaDB** as its database management system.

***

## Default tables

The structure of the CMS Full Form database includes several important tables. Some of the key tables in the CMS database include:

### fast\_comments

This table stores all the comments made by users on posts or pages. It typically contains fields like the comment content, the user who made the comment, the post/page it is associated with, and timestamps.

### fast\_files

This table is used for storing information about uploaded files on your site. It may store data such as the file name, file type, size, file path, and the user who uploaded it.

### fast\_languages

This table holds language settings for your site. It allows you to manage and store multiple languages, enabling multilingual support for your site.

### fast\_options

This table stores site-wide settings and configuration options. It may include general settings such as site name, logo, default language, SEO settings, and other custom configuration options.

### fast\_posttype

This table is used to define custom post types for the CMS. It allows you to create custom content types beyond the default posts and pages (e.g., products, events, etc.), providing more flexibility for content management.

### fast\_terms

The `fast_terms` table stores terms used for categorization, like tags and categories. These terms are used for categorizing and organizing posts or other content types.

### fast\_users

This table stores information about the users of the website. It contains data like usernames, passwords (hashed), roles (e.g., admin, editor, user), and other user-related details.

## Configuring the Database

To configure the database in CMS Full Form, you'll need to set up the database connection in the `Config.php` file, which is located in the `application/Config/` folder. Below is an example of how to configure the database settings:

```php
<?php
'db' => [
    'db_host'     => 'localhost',                // The database host, typically 'localhost'
    'db_username' => 'your_database_user',       // Your database username
    'db_password' => 'your_database_password',   // Your database password
    'db_database' => 'your_database_name',       // Your database name
    'db_driver'   => 'mysqli',                   // The database driver, typically 'mysqli' for MySQL
    'db_port'     => 3306,                       // The port number for the MySQL connection, default is 3306
    'db_charset'  => 'utf8mb4',                  // The character set for the connection, utf8mb4 is recommended
    'db_collate'  => 'utf8mb4_unicode_ci',       // The collation for the connection
],
```

#### Configuration Parameters:

* **db\_host**: The host where the database server is located. Typically, it is `localhost`, but if you're using a remote server, you will need to specify the host address.
* **db\_username**: The username for connecting to the database.
* **db\_password**: The password for the database user.
* **db\_database**: The name of the database you are using for your PHPFast CMS.
* **db\_driver**: This specifies the database driver. For MySQL databases, you will typically use `mysql` or `mongodb` as the driver. (Or you can see [Database ](https://docs.cmsfullform.com/documents/drivers/database)to details)
* **db\_port**: The port number used for the database connection. The default MySQL port is `3306`.
* **db\_charset**: The character set for the database connection. It is recommended to use `utf8mb4` to ensure proper support for all characters, including emojis.
* **db\_collate**: The collation for the database connection. `utf8mb4_unicode_ci` is commonly used as it supports a wide range of characters and sorts them correctly.

After configuring the database settings in `Config.php`, PHPFast should be able to connect to the database and use the default tables (e.g., `fast_comments`, `fast_users`, etc.) for storing and retrieving data.
