PHPackages                             react/mysql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. react/mysql

ActiveLibrary[Database &amp; ORM](/categories/database)

react/mysql
===========

Async MySQL database client for ReactPHP.

v0.6.0(2y ago)340442.6k↓40.3%70[15 issues](https://github.com/friends-of-reactphp/mysql/issues)[7 PRs](https://github.com/friends-of-reactphp/mysql/pulls)20MITPHPPHP &gt;=5.4.0CI passing

Since Feb 18Pushed 3mo ago22 watchersCompare

[ Source](https://github.com/friends-of-reactphp/mysql)[ Packagist](https://packagist.org/packages/react/mysql)[ RSS](/packages/react-mysql/feed)WikiDiscussions 0.7.x Synced 1w ago

READMEChangelog (10)Dependencies (8)Versions (20)Used By (20)

MySQL
=====

[](#mysql)

[![CI status](https://github.com/friends-of-reactphp/mysql/actions/workflows/ci.yml/badge.svg)](https://github.com/friends-of-reactphp/mysql/actions)

Async MySQL database client for [ReactPHP](https://reactphp.org/).

> **Development version:** This branch contains the code for the upcoming version 0.7 release. For the code of the current stable version 0.6 release, check out the [`0.6.x` branch](https://github.com/friends-of-reactphp/mysql/tree/0.6.x).
>
> The upcoming version 0.7 release will be the way forward for this package. However, we will still actively support version 0.6 for those not yet on the latest version. See also [installation instructions](#install) for more details.

This is a MySQL database driver for [ReactPHP](https://reactphp.org/). It implements the MySQL protocol and allows you to access your existing MySQL database. It is written in pure PHP and does not require any extensions.

**Table of contents**

- [Quickstart example](#quickstart-example)
- [Usage](#usage)
    - [MysqlClient](#mysqlclient)
        - [\_\_construct()](#__construct)
        - [query()](#query)
        - [queryStream()](#querystream)
        - [ping()](#ping)
        - [quit()](#quit)
        - [close()](#close)
        - [error event](#error-event)
        - [close event](#close-event)
- [Install](#install)
- [Tests](#tests)
- [License](#license)

Quickstart example
------------------

[](#quickstart-example)

This example runs a simple `SELECT` query and dumps all the records from a `book` table:

```
