Home > Database > Mysql Tutorial > body text

How to use MySQL database commands to create and view partitions

黄舟
Release: 2017-08-07 14:54:53
Original
3191 people have browsed it

MySQL partitioning is to decompose the database table into multiple parts according to certain rules to facilitate management. Each partition is an independent object and can be processed by itself or as part of the original table. Let's use several MySQL commands to view table partitions and create table partitions. The operations are as follows:

How to use MySQL database commands to create and view partitions

1. The first step is to check whether the current MySQL database supports partitioning. You can Use the following command

show variables like '%partition%';
Copy after login

as shown below:

How to use MySQL database commands to create and view partitions

2. The second step is to determine whether the current database version has a partition installed. Plug-in, use the following command

show plugins;
Copy after login

as shown below:

How to use MySQL database commands to create and view partitions

3. The third step is to create the database table and create the table Partition, use the command, and the error is reported, as shown below:

How to use MySQL database commands to create and view partitions


##4. The fourth step is to modify the primary key setting of the created database table, remove it, and run the command again, as shown in the following figure:

How to use MySQL database commands to create and view partitions


5. Step 5. Check whether a table is a partitioned table , you can use the following command

show table status;
Copy after login
as shown below:

How to use MySQL database commands to create and view partitions

6. The sixth step is to view a specific database For the partitioning of a table, you can use the following command, as shown in the figure below:

How to use MySQL database commands to create and view partitions


##Note

Note how to use commands to create table partitions

Note how to use commands to view partitions

The above is the detailed content of How to use MySQL database commands to create and view partitions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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