.. meta:: :description: MySQL preview :keywords: hasura, mysql, preview .. _mysql_preview: MySQL preview ============= .. contents:: Table of contents :backlinks: none :depth: 2 :local: Introduction ------------ We are in the process of launching support for MySQL, and we have a preview available for you to try. .. admonition:: Supported MySQL versions Hasura GraphQL engine currently supports **MySQL 8.0.14 and above**. Try it out ---------- MySQL support can be tried out using ``docker-compose`` and an existing MySQL database as follows: Prerequisites ^^^^^^^^^^^^^ - `Docker `_ - `Docker Compose `_ - An existing MySQL database Step 1: Get the docker-compose file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Get the Hasura MySQL preview docker compose file: .. code-block:: bash # in a new directory run wget https://raw.githubusercontent.com/hasura/graphql-engine/master/install-manifests/docker-compose-mysql-preview/docker-compose.yaml # or run curl https://raw.githubusercontent.com/hasura/graphql-engine/master/install-manifests/docker-compose-mysql-preview/docker-compose.yaml -o docker-compose.yaml Step 2: Update MySQL config ^^^^^^^^^^^^^^^^^^^^^^^^^^^ You need to now update the ``docker-compose.yaml`` file with credentials for your MySQL database *(replace the values surrounded by <>)* .. code-block:: yaml ... command: - graphql-engine - --mysql-host - - --mysql-user - - --mysql-port - - --mysql-dbname - - --mysql-password - ... Our :ref:`docker networking guide ` might be useful to set the appropriate value for ``mysql-host``. *(See Hasura to API)* Step 3: Run Hasura GraphQL engine ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The following command will run Hasura along with a Postgres database required for its functioning. .. code-block:: bash $ docker-compose up -d Check if the containers are running: .. code-block:: bash $ docker ps CONTAINER ID IMAGE ... CREATED STATUS PORTS ... 097f58433a2b hasura/graphql-engine ... 1m ago Up 1m 8080->8080/tcp ... b0b1aac0508d postgres ... 1m ago Up 1m 5432/tcp ... Step 4: Try out the GraphQL API ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The GraphiQL on the Hasura console available at ``http://localhost:8080/console`` can be used to try out the generated GraphQL API. **The Hasura console currently does not support managing the MySQL database schema**. i.e. The ``Data`` section of the console will not display the MySQL tables, etc. Hence the database schema needs to be managed externally as of now. *(support for this is coming very soon)* See the `source PR `__ for more information on current limitations and upcoming features. Keep up to date --------------- If you'd like to stay informed about the status of MySQL support, subscribe here: .. raw:: html
Give us feedback ---------------- We appreciate any feedback. Please open a new `GitHub discussion `__, and we can discuss there.