mysql--表的可能达到的最大大小
表的可能达到的最大大小: MAX_ROWS * AVG_ROW_LENGTH
[root@master ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.39 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database test;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE my_table (
-> id INT PRIMARY KEY,
-> name VARCHAR(100)
-> ) MAX_ROWS=1000, AVG_ROW_LENGTH=100 ;
ERROR 1046 (3D000): No database selected
mysql> use database;
ERROR 1049 (42000): Unknown database 'database'
mysql> use test;
Database changed
mysql> CREATE TABLE my_table (
-> id INT PRIMARY KEY,
-> name VARCHAR(100)
-> ) MAX_ROWS=1000, AVG_ROW_LENGTH=100 ;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE my_table
-> MAX_ROWS=2000, AVG_ROW_LENGTH=200 ;
ERROR 1113 (42000): A table must have at least 1 column
mysql> alter TABLE my_table
-> MAX_ROWS=2000, AVG_ROW_LENGTH=200 ;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>

浙公网安备 33010602011771号