【亿码酷站-编程开发教程】收集全网优质教程及源码资源!

全网优质软件开发、平面设计等教程及精品源码资源一站可得,www.ymkuzhan.com!

mysql怎么创建表空间_亿码酷站_亿码酷站插图

创建表空间

(推荐教程:mysql教程

sql语句:

mysql> create tablespace big_data_in_mysql add datafile 'first.ibd';
Query OK, 0 rows affected (0.57 sec)

上面这个语句就会创建一个名为big_data_in_mysql的表空间。同时这个表空间所对应的数据存放在first.ibd这个文件中。

因为这里没有指定存储目录,所以使用的是默认存储路径。这时,可以到默认数据存储文件夹下查看是否创建成功。

61de6eb46cc3e46fef47a0377ef4af8.png

查看表空间

mysql> select * from information_schema.INNODB_SYS_TABLESPACES ;
+-------+---------------------------------+------+-------------+------------+-----------+---------------+------------+---------------+-----------+----------------+
| SPACE | NAME                            | FLAG | FILE_FORMAT | ROW_FORMAT | PAGE_SIZE | ZIP_PAGE_SIZE | SPACE_TYPE | FS_BLOCK_SIZE | FILE_SIZE | ALLOCATED_SIZE |
+-------+---------------------------------+------+-------------+------------+-----------+---------------+------------+---------------+-----------+----------------+
|     2 | mysql/plugin                    |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |         65536 |     98304 |          98304 |
|     3 | mysql/servers                   |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |         65536 |     98304 |          98304 |
|     4 | mysql/help_topic                |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |         65536 |   9437184 |        9437184 |
····
|    93 | bas/t_bas_shop_item             |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |         65536 |    163840 |         163840 |
|   119 | insidemysql/student#p#p2        |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |         65536 |     98304 |          98304 |
|   120 | insidemysql/t                   |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |         65536 |     98304 |          98304 |
|   122 | test_tablespace                 | 2048 | Any         | Any        |     16384 |             0 | General    |         65536 |     65536 |          65536 |
|   125 | big_data_in_mysql               | 2048 | Any         | Any        |     16384 |             0 | General    |         65536 |     65536 |          65536 |
+-------+---------------------------------+------+-------------+------------+-----------+---------------+------------+---------------+-----------+----------------+
53 rows in set (0.03 sec)

删除表空间

DROP TABLESPACE tablespace_name
[ENGINE [=] engine_name]

相关推荐:php培训

mysql怎么创建表空间
—–文章转载自PHP中文网如有侵权请联系admin#tyuanma.cn删除

window怎么连接mysql

云服务器推荐