I am mainly in the maintenance of the OpenStack cloud platform will involve the operation of MySQL database, here to share with you common simple commands, but also to do a little exercise for themselves.1. Log in to the MySQL database123456Where,-h:the IP address or hostname of the MySQL server, if it is a native login, this option can be omitted;- u: Login user Name- p: login password for logged-in user2. View the database mysql> show databases; +--------------------+| Database |+---
MysqlInnoDB row lock implementation method bitsCN.com
Mysql InnoDB row lock implementation method InnoDB row lock is implemented by locking the index items on the index. this is different from Oracle in MySQL, the latter is implemented by locking the corresponding data rows in the data block. The implementation of InnoDB row locks means that InnoDB uses row-level locks only when data is retrieved through Index conditions. otherwise, InnoDB uses table locks! In practical applications, pay special
Source: UML Software Engineering Organization1 Windows Performance Counter analysis
Object
Counter
Analysis
Processor
%precessor time
recommended threshold value 85%
Memory
Available bytes
The recommended threshold value is less than 4MB to add memory;In addition, it is recommended to have at least 10% of physical memory value
Pages reads/sec
Page reads/
Tags: common operation of 3mysql[Email protected] ~]# mysql-uroot-pzaq12wsx #入库mysql> show databases; #查库ERROR 2006 (HY000): MySQL server has gone awayNo connection. Trying to reconnect ...Connection id:24Current database: * * * NONE * * *+--------------------+| Database |+--------------------+| Information_schema || Discuz || MySQL || Test |+--------------------+4 rows in Set (0.04 sec)mysql> use MySQL #切换库No connection. Trying to reconnect ...Connec
14 Insert the Age field type before the field name in the test table tinyint (2)Mysql> CREATE TABLE test (ID int (4) not NULL, name varchar (+) not NULL);Query OK, 0 rows affected (0.36 sec)mysql> desc test;+-------+-------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+-------+| ID | Int (4) | NO | | NULL | || name | varchar (16) | NO | | NULL | |+-------+---
Mysql InnoDB row lock implementation method InnoDB row lock is implemented by locking the index items on the index. This is different from Oracle in MySQL, the latter is implemented by locking the corresponding data rows in the data block. The implementation of InnoDB row locks means that InnoDB uses row-level locks only when data is retrieved through index conditions. Otherwise, InnoDB uses table locks! In practical applications, pay special attention to the InnoDB row lock feature. Otherwise,
means that when a transaction is accessing data and modifying the data has not been committed to the database, another transaction also accesses the data, then the data is used.
Session 1: mysql> select @ global. tx_isolation; + --------------------- + | @ global. tx_isolation | + ----------------------- + | REPEATABLE-READ | + ----------------------- + 1 row in set (0.00 sec) mysql> select @ session. tx_isolation; + --------------------- + | @ sessi
End With; or \g.Your MySQL Connection ID is 3Server version:5.6.40 MySQL Community Server (GPL)Copyright (c), 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of the Oracle Corporation and/or itsAffiliates. Other names trademarks of their respectiveOwners.Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.Mysql>5, set the server side, the client, the result set is UTF-8mysql> SET character_set_client = UTF8;Query OK, 0 r
discarded this parameter. Session 1 First add the myid>95 record to a current readMysql> Show CREATE TABLE Test_gap_lock\g1. Row ***************************Table:test_gap_lockCreate table:create Table ' Test_gap_lock ' (' id ' int (one) is not NULL,' Name ' varchar (+) DEFAULT NULL,' myID ' int (one) DEFAULT NULL,PRIMARY KEY (' id '),UNIQUE KEY ' uniq_name ' (' name '),KEY ' Idex_myid ' (' myID ')) Engine=innodb DEFAULT Charset=utf81 row in Set (0.00 sec
Tags: update ICA design mode engine Comm Dex same needsMysql InnoDB Line Lock Implementation method InnoDB row locks are implemented by locking the index entries on the index, which is different from Oracle, which is achieved by locking the corresponding data rows in the data block. InnoDB This type of row lock implementation is characterized by the fact that InnoDB uses row-level locks only if the data is retrieved by index criteria, otherwise INNODB will use a table lock! In practice, pay sp
Tags: using IO art CTI ar sql mysql tableNew Table T1 CREATE TABLE ' t1 ' (' a ' int (one) not null, ' B ' int (one) default NULL, PRIMARY KEY (' a ')) Engine=innodb default Charset=la Tin1; To view the transaction isolation level at the MySQL system level: Mysql> SELECT @ @global. tx_isolation;+-----------------------+|@ @global. tx_isolation |+-----------------------+| Repeatable-read |+-----------------------+1 row in Set (0.00 sec) View the tran
current number of bytes of memory that the process can use. Pages/sec indicates the number of pages fetched from disk due to hardware page faults, or the number of pages written to disk due to a page fault to free [url=] work [/url] Set space.If the value of Available Bytes is small (4 MB or less), the total memory on the computer may be insufficient, or a program does not release memory. If the value of PAGES/SE
;+ ------ + ------------- + ---------- +| User | host | password |+ ------ + ------------- + ---------- +| Root | localhost || Root | 192.168.0.1 || Root | 127.0.0.1 || Localhost || 192.168.0.1 |+ ------ + ------------- + ---------- +5 rows in SET (0.03 Sec)
Mysql> set password for root @ localhost = PASSWORD ('Enter the root password' here); then set the root password
For example, in my system, I set it as follows:
Mysql> set password for root @ loca
|
+ --------------------- +
1row in set (0.00 sec)
(2) Check the method used for replication.
Mysql> show variables like 'binlog _ format ';
+ --------------- + ----------- +
| Variable_name | Value |
+ --------------- + ----------- +
| Binlog_format | STATEMENT |
+ --------------- + ----------- +
1row in set (0.00 sec)
STATEMENT indicates SQL STATEMENT-based replication.
(3) create a table
Createtable tem
| + ----------------- + --------------- + 1 row in set (0.00 sec) dirty reads, can not be repeated read, phantom read is a major problem caused by transaction concurrency, and Repeatable read is used to solve the problem of non-repeated read. However, MySQL's Repeatable read level seems magical, and it can avoid phantom read. If Snapshot technology is used, all the above problems can be solved at one time without knowing how InnoDB works. First, the
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.