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:
1. The first step is to check whether the current MySQL database supports partitioning. You can Use the following command
show variables like '%partition%';
as shown below:
2. The second step is to determine whether the current database version has a partition installed. Plug-in, use the following command
show plugins;
as shown below:
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:
##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:
5. Step 5. Check whether a table is a partitioned table , you can use the following command
show table status;
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:
##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!