---
title: "Using MySQL views"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn how to create and manage MySQL views in Acquia Cloud Platform, including backup and restoration tips."
image:
type: "page"
url: "/acquia-cloud-platform/using-mysql-views"
id: "2ea13c93-787f-4219-a50a-37174d572083"
---

In MySQL, views are saved queries that act as a virtual table, producing a set of results when called.

Note

Views in MySQL should not be confused with the [Views](https://www.drupal.org/project/views) module in Drupal. This module is now part of Drupal core. However, it was not a part of Drupal core 7.

Cloud Platform supports the creation of MySQL views in databases, but databases containing views must be copied or restored using the Cloud Platform interface or the [Cloud Platform API](/acquia-cloud-platform/develop-apps/api). Both the Cloud Platform interface and Cloud Platform API remove infrastructure-specific `DEFINER` clauses from MySQL views that remain in place if you export the database using `mysqldump`. 

To create a `mysqldump` command that removes infrastructure-specific `DEFINER` clauses, you must pass the output of `mysqldump` output through a stream editor, replacing the values of `[SOURCE_DATABASE]` and `[TARGET_DATABASE]` that are invalid on Cloud Platform, as displayed in the following example:

    mysqldump [SOURCE_DATABASE] | LANG=C sed -e 's|^/[*]!50001 CREATE ALGORITHM=UNDEFINED [*]/|/*!50001 CREATE */|' -e '/^[/][*]!50013 DEFINER=/d' | mysql [TARGET_DATABASE]

All databases in a single Cloud Platform environment share the same username and password, but each environment in a subscription has its own username and password. For information about backing up databases in Cloud Platform and troubleshooting information about MySQL views, see [Taking backups](/acquia-cloud-platform/manage-apps/back-up) and [MySQL views in Cloud Platform](/acquia-cloud-platform/help/93666-mysql-views-acquia-cloud "MySQL views in Acquia Cloud").

Note

You cannot create users to have the read-only permission to databases using MySQL.