> For the complete documentation index, see [llms.txt](https://doc.telosys.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.telosys.org/project-databases/mysql-database.md).

# MySQL database

## Telosys database configuration

Below are examples of typical configurations for a **MySQL** database.

### Since Telosys 4.3

<pre class="language-yaml"><code class="lang-yaml"><strong>  - id: mysqldb
</strong>    name: MySQL 'employees' database 
    type: MYSQL 
    # URL jdbc:mysql://&#x3C;host>:&#x3C;port>/&#x3C;database>?&#x3C;options>
    url: jdbc:mysql://myhost:3306/employeesdb
    user: john_doe
    password: not_to_reveal
</code></pre>

### Before Telosys 4.3

```yaml
  - id: mysqldb
    name: MySQL 'employees' database 
    type: MYSQL 
    # JDBC driver 
    driver: com.mysql.cj.jdbc.Driver
    # URL jdbc:mysql://<host>:<port>/<database>?<options>
    url: jdbc:mysql://myhost:3306/employeesdb
    user: john_doe
    password: not_to_reveal
    # Metadata parameters
    tableNamePattern: '%'
    tableTypes: TABLE

```

### JDBC driver

* Download:&#x20;
  * Web site: <https://dev.mysql.com/downloads/connector/j/>  \
    "MySQL Connector/J"
  * MVN Repository: <https://mvnrepository.com/search?q=mysql> \
    "MySQL Connector/J"
* JAR file example:  `mysql-connector-j-9.5.0.jar`&#x20;
* Driver class name:  **com.mysql.cj.jdbc.Driver**  (since Connector/J 8.0)\
  (old versions used **com.mysql.jdbc.Driver**)

## Technical information about MySQL

### Structure

Server → **Database** (= **Schema**) → Tables/Objects

<div align="left"><figure><img src="/files/mfLZc34c1Jm4tPnYnbbv" alt="" width="242"><figcaption></figcaption></figure></div>

* **Database**: The main organizational unit. In practice, a "**database**" in MySQL is what most people think of as a "**schema**". When you run `CREATE DATABASE`, it’s like creating a schema.
* **Schema**: Synonymous with database. \
  MySQL treats `CREATE DATABASE foo;` and `CREATE SCHEMA foo;` as the same operation.
* **Cross-database** queries (cross-schema) are allowed within the same server instance (`db1.table1 JOIN db2.table2`)

### Case conversion rules

* **column name**: \
  in MySQL, column names are **not case-sensitive**, \
  whether the identifiers are in quotes or not.
* **table name** (file system rules matter):\
  \- on **Linux**: may be case-sensitive only if  `lower_case_table_names=0`\
  \- on **Windows**/**macOS**:  case-insensitive.
