In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Xiaobian to share with you MySQL in the table DATA DIRECTORY, INDEX DIRECTORY what is the use, I believe most people do not know how, so share this article for everyone's reference, I hope you read this article after a great harvest, let's go to understand it together!
Introduction:
MySQL creates a table by default under the datadir path. When the datadir space is insufficient, you can specify DATA DIRECTORY and INDEX DIRECTORY when rebuilding the table to store the new table data on other disks. For example: /data/lottery/;
Tip:
The INNODB table is an independent table space (innodb_file_per_table=1).
At present, only after 5.6 can single table specify directory, and the directory is mysql:mysql.
The DATA DIRECTORY and INDEX DIRECTORY options will be ignored in Windows.
4. DATA/INDEX DIRECTORY does not support enabling skip-symbolic-links parameter; www.51edu.com/it/bckf/117508.html
5. Ordinary table DATA/INDEX DIRECTORY is specified only when the table is being built, and cannot be changed by alter table;
Partition table can alter add PARTITIONS data DIRECTORY...
Experiment:
MYSQL> CREATE TABLE t_1 engine=innodb DATA DIRECTORY="/data/lottery/" INDEX DIRECTORY="/data/lottery/" as select * from zabbix.history;
The requested URL/data/lottery/was not found on this server.
[root@localhost test]# ll /data/db/test/t_1.*
-rw-rw--- 1 mysql mysql 17070 March 31 15:06 /data/db/test/t_1.frm
-rw-rw--- 1 mysql mysql 24 Mar 31 15:06 /data/db/test/t_1.isl
[root@localhost test]#
--The contents of the file point to the above.ibd file, which is actually equivalent to a link
[root@localhost test]#cat /data/db/test/t_1.isl
/data/lottery/test/t_1.ibd
[root@localhost test]# ll
-rw-rw--- 1 mysql mysql 212992 Mar 31 15:06 /data/lottery/test/t_1.ibd ---> Real data storage location
[root@localhost test]#
The above is "MySQL in the table DATA DIRECTORY, INDEX DIRECTORY what to use" all the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.