Metadata-Version: 2.4
Name: devart-mysql-connector
Version: 1.4.0
Summary: New level of functionality and performance in data access via Python
Home-page: https://devart.com
Author: Devart
Author-email: support@devart.com
License: Other/Proprietary License
Project-URL: Homepage, http://devart.com/python/mysql
Project-URL: Download, http://devart.com/python/mysql/download.html
Project-URL: History, http://devart.com/python/mysql/revision_history.html
Project-URL: License, https://www.devart.com/python/eula.html
Project-URL: Documentation, http://docs.devart.com/python/mysql/overview.htm
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# Python Connector for MySQL #

Python Connector for MySQL is a connectivity solution for accessing MySQL
databases from Python applications. It fully implements the Python DB API 2.0
specification. The connector is distributed as a wheel package for Windows,
macOS, and Linux.

Direct connection

The connector enables you to establish a direct connection to MySQL from
a Python application via TCP/IP, eliminating the need for the database client
library. A direct connection increases the speed of data transmission between
the application and MySQL database server. It also streamlines the deployment
process since you don't have to distribute any client libraries with
the application.

Secure communication

The connector supports encrypted communications using SSL/TLS, SSH tunneling,
and HTTP/HTTPS tunneling.

## Connecting ##

To establish a connection to a MySQL database, import the connector and use
the `connect()` method with your connection parameters.

### Import the connector ###

First, import the MySQL connector module:

```
import devart.mysql as mysql
```

### Establish a connection ###

Call the `connect()` method and obtain a `connection` object.

```
my_connection = mysql.connect(
    Server="your_server",    Database="your_database",    UserId="your_username",    Password="your_password"
)
```

Replace the example values with your actual connection values.

## Querying data ##

Once connected to MySQL, you can execute SQL queries to retrieve data from
your MySQL database.

### Execute a query ###

Create a `cursor` object using the `cursor()` connection method.
```
my_cursor = my_connection.cursor()
```
Execute a SQL query using the `execute()` cursor method.
```
my_cursor.execute("SELECT * FROM employees")
```
Retrieve results using one of the `fetch*()` methods.
```
for row in my_cursor.fetchall(): 
    print(row)
```

### Parameterized queries ###

You can use parameterized queries to pass variable values to your SQL statements. This allows you to reuse the same query with different data and helps to prevent SQL injection attacks.

Pass parameters as a list or tuple to the `execute()` method:

```
query = "SELECT Id, Name FROM Contact WHERE Name = ? AND Email = ?"
params = ["Jordan Sanders", "jordansanders@example.com"]
my_cursor.execute(query, params)
results = my_cursor.fetchall()
for row in results:
    print(row)
```

Each placeholder `?` in the query is replaced with a corresponding value from the parameter list.

## Ordering and activating the license ##

You can purchase a license for the connector on the ordering page:             
https://www.devart.com/python/mysql/ordering.html

To activate the license, follow the instructions in the documentation:             
https://docs.devart.com/python/mysql/activate-a-license.htm

## What's new ##

Python Connector for MySQL 1.4

- Added support for Python 3.15
- Added support for MySQL 9.7
- Added support for generated columns
- Added support for handling the new ER_CLIENT_INTERACTION_TIMEOUT error packet
- Added support for the authentication_ldap_sasl authentication plugin with the GSSAPI mechanism
- Improved support for the GSSAPI authentication plugin
