Home > Database > Mysql Tutorial > body text

What are the prerequisites before starting to write and use MySQL views?

王林
Release: 2023-08-29 18:45:08
forward
980 people have browsed it

开始编写和使用 MySQL 视图之前有哪些先决条件?

MySQL version

We know that MySQL 5 introduces views, so before we start writing, we first need to check the version of MySQL and use stored procedures. This can be done through the following query -

mysql> Select VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.7.20    |
+-----------+
1 row in set (0.10 sec)
Copy after login

Current user's permissions

In fact, the CREATE VIEW statement requires CREATE VIEW permissions. The permissions of the current user can be checked using the following query -

mysql> SHOW PRIVILEGES
Copy after login

Select Database

Before creating the view, we have to select a database from the available databases. This can be done with the help of the following query -

mysql> USE query;
Database changed
Copy after login

From the above query, it is obvious that we are using the database named "query".

The above is the detailed content of What are the prerequisites before starting to write and use MySQL views?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!