Retake course day38 (MySQL II)

Source: Internet
Author: User
Tags connection pooling mysql client one table types of tables

(View system services, enter services.msc in the run)

Add: Make MySQL system service: mysqld--install

Cancellation: Mysqld--romove

The start and stop of MySQL service can be operated directly by mouse in the service
can also be manipulated in cmd
net start MySQL
net stop MySQL

A storage engine

What is a storage engine: In a database, the types of tables are different, and the storage engine is the type of the table. The database also has different processing methods for different storage engines.

Show engines: View a storage engine.

Mysql> Show engines;+--------------------+---------+--------------------------------------------------------- -------+--------------+------+------------+| Engine | Support | Comment | Transactions | XA | savepoints |+--------------------+---------+----------------------------------------------------------------+--- -----------+------+------------+| InnoDB | DEFAULT | Supports transactions, Row-level locking, and foreign keys | YES | YES | YES | | Mrg_myisam | YES | Collection of identical MyISAM tables | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | Blackhole | YES | /dev/null Storage Engine (anything you write to it disappears) | NO | NO | NO | | MyISAM | YES | MyISAM Storage Engine | NO | NO | NO | | CSV | YES | CSV Storage Engine | NO | NO | NO | | ARCHIVE | YES | Archive Storage Engine | NO | NO | NO | | Performance_schema | YES | Performance Schema | NO | NO | NO | | Federated | NO | Federated MySQL Storage Engine | NULL | NULL | NULL |+--------------------+---------+----------------------------------------------------------------+--------- -----+------+------------+9 rows in Set (0.00 sec)

Connection pooling: Implementing concurrency, connection pooling allows multiple clients to use cached connection objects that can connect to the database, are shared between them, and can be reused.

                 

For more information, please visit: http://www.importnew.com/8179.html

Common Storage engines:

InnoDB: Supports things, supports things security tables, supports row locking and foreign keys.

What is a transaction: a sequence of operations performed by a single logical unit that either succeeds or does not succeed. Details visit: https://zhidao.baidu.com/question/1689625077782008388.html

mysql> CREATE TABLE t1 (id int) Engine=innodb; Query OK, 0 rows affected (0.69 sec) mysql> Show create table t1;+-------+-------------------------------------------- ------------------------------------------+| Table | Create Table                                                                         |+-------+------------------------------------------------------------------------------------ --+| T1    | CREATE TABLE ' t1 ' (  ' id ' int (one) default NULL) engine=innodb default Charset=utf8 |+-------+------------------------ --------------------------------------------------------------+1 Row in Set (0.05 sec)

MyISAM: Nothing is supported, the speed is very fast, the table information is divided into 3 files to store.

mysql> CREATE table t4 (id int) Engine=myisam; Query OK, 0 rows affected (0.13 sec) mysql> Show create table t4;+-------+-------------------------------------------- ------------------------------------------+| Table | Create Table                                                                         |+-------+------------------------------------------------------------------------------------ --+| T4    | CREATE TABLE ' T4 ' (  ' id ' int (one) default NULL) Engine=myisam default Charset=utf8 |+-------+------------------------ --------------------------------------------------------------+1 Row in Set (0.03 sec)

Blackhole: There is only one table structure file, no data, is a black hole storage engine, data viewing is not data

mysql> CREATE TABLE t3 (id int) engine=blackhole; Query OK, 0 rows affected (0.17 sec) mysql> Show create table t3;+-------+-------------------------------------------- ---------------------------------------------+| Table | Create Table                                                                            |+-------+------------------------------------------------------------------------------------ -----+| T3    | CREATE TABLE ' T3 ' (  ' id ' int (one) default NULL) engine=blackhole default Charset=utf8 |+-------+--------------------- --------------------------------------------------------------------+1 Row in Set (0.00 sec)

Memory: There is only one table structure file, all of the data is stored in RAM, the data will be lost after shutdown.

Mysql> CREATE TABLE t2 (id int) engine=memory; Query OK, 0 rows affected (0.12 sec) mysql> Show create table t2;+-------+-------------------------------------------- ------------------------------------------+| Table | Create Table                                                                         |+-------+------------------------------------------------------------------------------------ --+| T2    | CREATE TABLE ' T2 ' (  ' id ' int (one) default NULL) engine=memory default Charset=utf8 |+-------+------------------------ --------------------------------------------------------------+1 Row in Set (0.00 sec)

For more information, please visit: http://blog.csdn.net/zhangyuan19880606/article/details/51217952

\s: View the current client and server character encodings.

Foregin keys: Establish a table-to-table relationship.

Two-file configuration

Here's how:

#在mysql的解压目录下, create a new My.ini, and then configure # #. The following configuration takes effect when the mysqld command is executed, that is, when the MySQL service is started [mysqld];skip-grant-tablesport=3306character_set_server= utf8default-storage-engine=innodbinnodb_file_per_table=1# extracted directory Basedir=e:\mysql-5.7.19-winx64#data directory datadir=e:\ My_data #在mysqld--initialize, the initial data is stored in the directory specified here, and after initialization, when MySQL is started, it will go to this directory to find data #. For the global configuration of the client commands, the following configuration takes effect when the MySQL client command executes [client]port=3306default-character-set=utf8user=rootpassword=123#3. Only for MySQL this client configuration, 2 is the global configuration, and here is only for MySQL this command local configuration [MySQL];p Ort=3306;default-character-set=utf8user=egonpassword =4573#!!! If there is no [MySQL], the user's configuration when executing the MySQL command is based on [client]

Retake course day38 (MySQL II)

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.