InnoDB Engine mysql Data storage location

use InnoDB After the database of the engine creates the table , Will be in mysql Create a directory with the same database name under the data storage directory . This directory contains a db.opt The file has the same name as all the tables in the library frm file .

1、db.opt The file stores the character set and collation of all tables in the library

2、 Table name .frm The file stores the structure of the corresponding table

3、ibdata1 File is InnoDB The core file that stores data , It is shared by all tables , Is the shared space of all tables . This file stores the data and indexes of all tables .

About ibdata1 The use of documents :

When there are more and more tables in the database ,ibdata1 The file will get bigger and bigger , So you need to release or shrink the file .

Division ibdata1 file :

Division ibdata1 The file lets each table use a separate ibdata1 file .

step :

1、 Use mysqldump Tools back up all database data .

2、my.cnf File joining :

innodb_file_per_table

3、 Delete the original ibdata1 and ib_logfile* file , Delete mysql The directory of the application database under the data storage directory .

4、 Import the backup data into mysql

InnoDB More articles about where to store engine data

  1. MySQL Database data storage location modification

    MySQL Database data storage location modification MySQL Is a relational database management system , The Swedish MySQL AB Companies to develop , At present belongs to the Oracle Its products .MySQL The most popular relational database management system , stay WEB Applied by ...

  2. Navicat Data storage location and backup database path settings

    navicat Where is your database located ? With this question , We're going to solve the problem ,navicat Is the default installation ,mysql It's also the default installation , The database exists under the directory of the default user . install MySQL when , Please select “Custom” ...

  3. CentOS6 change Mysql The data storage location of the database

    mysql Use yum When installing , The default data is stored in /var/lib/mysql Next . In general , For data security , It is suggested that mysql The data files of the database are stored in the directory on the second disk of the system. You can follow the following steps : ...

  4. MySQL See where the data is stored

    show global variables like "%datadir%";

  5. B-Tree and B+Tree Structure and application ,InnoDB engine , MyISAM engine

    1. What is? B-Tree and B+Tree, What do they do for ? B-Tree It is a multi fork balanced search tree designed for disk or other storage devices ,B-Tree and B+Tree  It is widely used in file storage system and database system . ...

  6. mysql utilize yum Install the specified data storage path

    Test environment : Centos6.5.MySQL5.6.28 yum Installation is fast , The key to convenience is not to compile , It took too long to compile ! 01. download mysql https://mirrors.tuna.tsinghua.e ...

  7. Mysql stay InnoDB The case of index invalidation row level lock changing to table lock under the engine

    Get ready first , establish InnoDB Engine data table , And added the corresponding index DROP TABLE IF EXISTS `innodb_lock`; CREATE TABLE `innodb_lock` ( `a` ) ...

  8. MySQL5.7 See where the data is stored

    stay MySQL The client executes the following command to view MySQL Where to store your data : mysql> show global variables like "%datadir%"; +-------- ...

  9. MySQL-5.7 Set up InnoDB Table data file storage location

    1. Table space Innodb The storage engine can store all data in ibdata* Shared tablespaces for , Each table can also be stored in a separate .ibd Independent tablespaces for files . Shared table space and independent table space are all for the storage of data . Shared tablespace : ...

Random recommendation

  1. Apple safari browser window.open problem

    The phenomenon : In the process of doing the project , Use window.open Open a new window , stay windows Systematic ie,firefox,chrome There are no problems in the tests on the browser , In the apple system safari Some of them were found on the browser window.op ...

  2. IBatis Add information back to the current add object ID

      stay Ibatis in ,insert() Returns a value of 1 Object Primary key of , Actually this Object The primary key of is like this : If in bean Of xml The file has the inserted keyProperty, be insert() Way back ...

  3. Could not resolve placeholder

    Use spring Of <context:property-placeholder location="/WEB-INF/redis.properties"/> Read prope ...

  4. python join and split How to use it

    function :string.join()Python There is join() and os.path.join() Two functions , The specific functions are as follows :    join():     Connection string array . The string . Tuples . Elements in the list with the specified characters ...

  5. [Swift]LeetCode320. General abbreviation $ Generalized Abbreviation

    Write a function to generate the generalized abbreviations of a word. Example: Given word = "wo ...

  6. 「 Make a wheel 」——cicada( Lightweight WEB frame )

    Preface It is said that 「 Don't make wheels over and over again 」, As to whether it is necessary to leave out of the scope of this discussion . The main purpose of this project is to improve yourself , Look at the gap with well-known open source projects and learn excellent open source methods . Okay , Now let's talk about cicada This project ...

  7. Pandas series ( 7、 ... and )- Introduction to computing tools

    Content catalog 1. Statistical function 2. Window function 3. Deepen and strengthen Data preparation # Import related libraries import numpy as np import pandas as pd #Pandas There's a lot of computation in it ...

  8. HTML+CSS Basics (1)- Understand what is HTML and CSS

    What is? HTML w3c Is explained as follows : HTML It's a language used to describe Web pages . HTML Hypertext markup language (Hyper Text Markup Language) HTML Not a programming language , It's a kind of ...

  9. 【Teradata 】TD Maximum number of columns

    1. What is the maximum number of columns in a table ? DB2, The maximum number of columns in the table 1012, The maximum number of columns in the view 5000: Maximum line length 32677Byte Teradata The maximum number of columns in a table and the maximum number of columns in a view 2048,:16 Before version , The maximum length of a line is 64k ...

  10. npm run dev Report errors Outdated Version

    The solution is : Use the command first : npm -v Check out your version ( I used to be V3.1 no way ) And then use cnpm install -g npm   An updated version npm - v Become the latest 4.0.4 npm run d ...