MySQL indexes are used to quickly find records with specific values, and all MySQL indexes are saved as B-trees
If the query is not indexed, MySQL must start the whole table scan from the first record, knowing that the query to the required
Today, let's explore a very important concept in the database: index.MySQL official definition of the index is: index is to help MySQL efficient data acquisition data structure, that is, the index is a structure.We know that database query is one of
1. Why duplicate data appears when two tables are connected2. What is the connection process of the table?Example:Table A:10Table B:1002EXECUTE statement: SELECT * from A join B on a.id = b.id;The order is as follows:Tables formed by join:1 11 01 01
In fact, the majority of this tutorial with "(a) Build local virtual machine-ubuntu+mysql" almost, but in the middle of a lot of things, the server has been done, so the process will be more than the native installation of virtual machine simple,
First, to say the concept of lockLock level:1. Row-level Lock: InnoDB engine (also supports table-level lock, default is row-level lock), high overhead, locking slow; a deadlock occurs. Locking granularity is minimal, the probability of lock
1.1 MySQL Installation and basic configuration (CentOS 7.3)1. Install MySQL using yumYum Install Mysql-community-server2. Common commands for MySQL managementSystemctl Status MysqldSystemctl Start mysqldSystemctl Stop Mysqld3. Boot startSystemctl
MySQL Replication databaseTo make it easy to copy a database quickly, you can use the following commandCopy the data from the DB1 database and the table structure to the NEWDB databaseCreate a new database#mysql -u root -p123456mysql>CREATE DATABASE
Here are two ways to install MySQL under Linux: Yum installation and source code compilation installation.1. Yum Installation(1) First check if the CentOS comes with MySQL is installed:yum List installed | grep MySQL // If you have your own MySQL
Table name Heyf_t10, which is used to test the statementINSERT into Heyf_t10 (Empid, DeptID, salary)VALUES(1, 2, 3) On DUPLICATE KEY UPDATE empid = 1,DeptID = 2,Salary = 5The original data is, the unique key is set, then executes the above SQL,
MySQL DatabaseMySQL database is a relational database management system developed by the Swedish MySQL AB company. MySQL is an associated database management system that keeps data in separate tables rather than putting all of the data in a large
1. Change the data in the table (DML)CREATE TABLE T_user (ID int primary KEY auto_increment,Name varchar () is not NULL,Email varchar (unique))Add a record to a table (must be mastered)insert into table name [(column name 1, column Name 2 ...)]
Mysqlbinlog common options include the following:--start-datetime: Reads from the binary log specify a time equal to the timestamp or later than the local computer--stop-datetime: Reads from binary log specified less than timestamp or equal to local
Query the fields of the table:--Query the field name of the tableSELECTcolumn_name--Group_concat (' A. ', column_name) as column_name--Add table aliases and connect with commas frominformation_schema. COLUMNSWHERETable_schema= 'Hera' --Database name
1. Install Pymysql via PIP to enter the cmd input pip install Pymysql Enter to wait for the installation to complete, the installation is complete after the relevant information, indicating that the installation was successful. 2. Test Connection
Because of the similarity of text, we need a lot of data, but also need to store the data, the ID of the text can be extracted directly when the comparison is made.First to install MySQL, I was downloaded from the Baidu Software library
To test the table table structure:Mysql> Show CREATE TABLE Dr_stats\g1. Row Table:dr_statscreate table:create Table ' dr_stats ' (' ID ' bigint () unsigned not NULL auto_increment, ' views ' Int (ten) NOT null default ' 0 ' COMMENT '
Mysql built-in optimization tools show profiles and mysqlprofiles
I. Overview:
Currently, the Mysql explain tool is not as powerful as the explain plan tool of Oracle, but the show profiles tool can achieve similar results. The show profiles
Mycat implements Mysql master-slave read/write splitting and mycatmysql master-slave read/write
I. Overview
There are many online Mycat principles. I will not detail them here. For me, Mycat has the following functions:
1. Mysql Master/Slave
Mysql enables slow query (description of SQL statements) and mysqlexplain
Today, database operations are increasingly becoming the performance bottleneck of the entire application, especially for Web applications. Concerning the database performance,
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