因为我需要几个中间文本字段,所以我需要梭鱼文件格式。有很多关于如何将现存的羚羊表转换成梭鱼的文章和视频,但是没有关于如何使用梭鱼创建一个新的表。用MariaDB很容易做到这一点吗?如果可能的话,我想用码头集装箱。
发布于 2017-05-13 17:39:04
尝试:
MariaDB [_]> SELECT VERSION();
+-----------------+
| VERSION() |
+-----------------+
| 10.1.23-MariaDB |
+-----------------+
1 row in set (0.00 sec)
MariaDB [_]> SHOW VARIABLES LIKE 'innodb_file_format';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| innodb_file_format | Antelope |
+--------------------+----------+
1 row in set (0.01 sec)
MariaDB [_]> CREATE TABLE `barracuda_table` (`col` MEDIUMTEXT) ROW_FORMAT=DYNAMIC;
Query OK, 0 rows affected, 2 warnings (0.00 sec)
MariaDB [_]> SHOW WARNINGS;
+---------+------+--------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------------+
| Warning | 1478 | InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
| Warning | 1478 | InnoDB: assuming ROW_FORMAT=COMPACT. |
+---------+------+--------------------------------------------------------------------+
2 rows in set (0.00 sec)
MariaDB [_]> SELECT ROW_FORMAT
-> FROM `information_schema`.`tables`
-> WHERE `TABLE_SCHEMA` = DATABASE() AND
-> `TABLE_NAME` = 'barracuda_table';
+------------+
| ROW_FORMAT |
+------------+
| Compact |
+------------+
1 row in set (0.00 sec)
MariaDB [_]> DROP TABLE `barracuda_table`;
Query OK, 0 rows affected (0.00 sec)
MariaDB [_]> SET @@GLOBAL.innodb_file_format = 'Barracuda';
Query OK, 0 rows affected (0.00 sec)
MariaDB [_]> SHOW VARIABLES LIKE 'innodb_file_format';
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| innodb_file_format | Barracuda |
+--------------------+-----------+
1 row in set (0.00 sec)
MariaDB [_]> CREATE TABLE `barracuda_table` (`col` MEDIUMTEXT) ROW_FORMAT=DYNAMIC;
Query OK, 0 rows affected (0.00 sec)
MariaDB [_]> SELECT ROW_FORMAT
-> FROM `information_schema`.`tables`
-> WHERE `TABLE_SCHEMA` = DATABASE() AND
-> `TABLE_NAME` = 'barracuda_table';
+------------+
| ROW_FORMAT |
+------------+
| Dynamic |
+------------+
1 row in set (0.00 sec)
MariaDB [_]> SELECT `NAME`, `FILE_FORMAT`, `ROW_FORMAT`
-> FROM `information_schema`.`INNODB_SYS_TABLES`
-> WHERE `NAME` = '_/barracuda_table';
+-------------------+-------------+------------+
| NAME | FILE_FORMAT | ROW_FORMAT |
+-------------------+-------------+------------+
| _/barracuda_table | Barracuda | Dynamic |
+-------------------+-------------+------------+
1 row in set (0.00 sec)发布于 2017-05-15 00:53:02
它在5.6中很混乱(MariaDB 10.0和10.1):
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_large_prefix=1; -- optional (if you also need wide indexes)
ALTER TABLE tbl ROW_FORMAT=DYNAMIC;它可能在5.7 (MariaDB 10.2)中被正确地默认。
https://stackoverflow.com/questions/43955210
复制相似问题