MySQL Storage engine

Source: Internet
Author: User
Tags table definition install perl

Two kinds: MyISAM:

???????????? MyISAM is the default storage engine. Each myisam is stored as three files on disk, and each file name starts with the name of the table, and the extension indicates the file type.

??????????? . frm file storage table definition;

?????????? · MYD (MYData) file stores the data of the table;

??????????? . The MYI (myindex) file stores the index of the table.

????????????? InnoDB (version supported by MySQL5.7):

?????????? The preferred engine for transactional databases, which supports acid transactions and supports row-level locking. The InnoDB is designed for maximum performance when dealing with large amounts of data. The InnoDB storage engine is fully integrated with the MySQL server, and the InnoDB storage engine maintains its own buffer pool to cache data and indexes in main memory. InnoDB stores its tables & indexes in a table space, a tablespace can contain several files (or raw disk partitions). This is different from the MyISAM table, such as in the MyISAM table where each table is in a separate file. The InnoDB table can be any size, even if the file size is limited to 2GB on the operating system. The InnoDB is included in the MySQL binary distribution by default. Windows Essentials Installer makes InnoDB a default table for MySQL on Windows.

To see how the table uses the storage engine type:

?? 1.show? Table?? Status? From? Library name? where? Name? =? ' Table name '

?? 2.use? Database

?????? Show?? Create?? Table?? Table name;

Ways to modify the type of storage engine used by the table:

?? 1.alter?? Table?? Table_name?? Engine = Engines

?? 2.vim?? /etc/my.cnf

???? Add Default-storage-engine=myisam under "Mysqld"

??? Then restart the service, and create a new table that takes effect

?? 3.create? Table? Table name (attribute type) engine = Engines

?? 4.mysql_convert_table_format command

Bulk modifying the storage engine type of a database table

1. Build mysql5.5 under the Centos7

Tar zxvf mysql-5.5.24.tar.gz? -C? /opt/

Confirm installation of GCC, gcc-c++, make, CMake
Ncurses-devel,
Bison
Libaio-devel's Package

---------------add MySQL users and join the MySQL group----------------
Useradd? -s/sbin/nologin MySQL
Mkdir/usr/local/mysql

Cd/opt/mysql-5.5.24.tar.gz

Cmake-dcmake_install_prefix=/usr/local/mysql??????
-dmysql_unix_addr=/home/mysql/mysql.sock???????????
-ddefault_charset=utf8????????????????????????????
-ddefault_collation=utf8_general_ci
-dwith_extra_charsets=all?????????????????????????
-dwith_myisam_storage_engine=1?????????????????????
-dwith_innobase_storage_engine=1
-dwith_memory_storage_engine=1
-dwith_readline=1?????????????????????????????????
-denabled_local_infile=1???????????????????????????
-dmysql_datadir=/home/mysql????????????????????????
-dmysql_user=mysql???????????????????????????????????
-dmysql_tcp_port=3306?????????????????????????????????

Make?? &??? Make install??

Chown-r mysql.mysql/usr/local/mysql????????

Export path= $PATH:/usr/local/mysql/bin/?? \* Refresh *\????????? when powered on

Alternatively, you can select Vi/etc/profile to run after the last line joins Source/etc/profile

CP support-files/my-medium.cnf/etc/my.cnf?????????????????

CP Support-files/mysql.server/etc/init.d/mysqld?????????????

chmod 755/etc/init.d/mysqld????????????????????????????
Chkconfig--add/etc/init.d/mysqld?????????????????????
Chkconfig mysqld--level??????????????????????????

--------------Initialize the database------------------------------------------------

/usr/local/mysql/scripts/mysql_install_db \
--user=mysql \
--ldata=/var/lib/mysql \
--basedir=/usr/local/mysql \
--datadir=/home/mysql

ln? -S? /var/lib/mysql/mysql.sock?? /home/mysql/mysql.sock?????????? /* Create a soft connection directly */

Vi/etc/init.d/mysqld
Basedir=/usr/local/mysql
Datadir=/home/mysql

Systemctl? Start?? Mysqld.service

Mysqladmin? –u? Root? Password? ' abc123 '???? Set Root password

2. Go to MySQL


??????

Install PERL-DBI? and Perl-dbd-mysql:

???? Yum? Install? Perl-dbi? -Y

???? Yum? Install? Perl-dbd-mysql?? -Y???

?????? Mysql_convert_table_format? --host=localhost? --user=root? --password=abc123?? --socket=/tmp/mysql.sock?? --engine=myisam School Bank Banks??? Batch Modification

?????

?????

MySQL Storage engine

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.