Scripts to monitor long transactions#!/bin/bashMysql-n-uroot-p ' password '-e ' select Now (), (Unix_timestamp (now ())-Unix_timestamp (a.trx_started)) Diff_sec,b.id,b.user, B.host,b.db,d.sql_text from Information_schema.innodb_trx a inner
Before explaining the Binlog log three modes, first understand the Binlog log to resolve the command workers Mysqlbinlog. The role of the Mysqlbinlog tool is to parse the MySQL binary binlog log content and parse the binary log into SQL statements
PartitionPartitioning is the distribution of files and indexes of a data table in different physical files.The types of partitions supported by MySQL include range, List, Hash, Key, where range is more commonly used:Range partition : Assigns
1.pooling: The value of this key is set to true and any newly created connection will be added to the connection pool when the program is closed, the connection is taken from the connection pool the next time you try to open the same connection, and
The table header contains:ID---select_type---table---type---possible_keys---key---key_len---ref---rows---Extra
The sequence number of the Id:select query, which contains a set of numbers that represents the order in which a SELECT clause or
One: Lamp architectureII: MYSQL/MARIADB IntroductionThree: MySQL InstallationSeveral popular versions of MySQL download5.1_64 bits binary Package: http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-x86_64-glibc23.tar.gz5.1_32 bits binary
Let's start by talking about the primary key and the unique index: a table of one database has only one primary key , and a primary key cannot repeat a unique index: a single table on a database can have multiple , just the value on the unique index
MySQL is a true multi-threaded, multi-user SQL database service that has become the most popular open source database system in the server domain with its high performance, reliability, and ease of use. Prior to 2008, the MySQL project was developed,
Additions and deletions (curd) Curd Explanation: representative creation (create), Updates (update), read (Retrieve), and delete queries basic use
Querying all Columns
SELECT * from table name;Example:SELECT * from Classes;
EnvironmentOs:centos7MySQL version: MySQL 5.7keepalived:keepalived-1.2.20mysql-vip:192.168.41.100mysql-master1:192.168.41.10mysql-master2:192.168.41.11Lab environment Close Firewall rule firewall-cmd
First, the configuration of two MySQL
Make sure the primary database is the same as the data from the database"Master server" color 38 platform Repair (Enterprise e: 217 1793 408)1. Create an account for backup from the server and only need to grant replication slave permissions.mysql>
1.WITH ROLLUP: Statistical data is performed on the basis of the Group field.Example: First group on the Name field, then some field statistics on the basis of the grouping, the table structure is as follows:CREATE TABLE' Test ' (' Id ')int( One)
On the MySQL server, view the/etc/my.cnf fileSet up:log-queries-not-using-indexes=onlong_query_time=0.03log-slow-queries=/var/log/mysql/mysqld.queries-slow.log
1
2
3
Log-queries-not-using-indexes=on open an SQL statement record
When MySQL is doing DDL operations such as ALTER TABLE, there are times when waiting for table metadata lock is waiting for the scene. Furthermore, once ALTER TABLE TableA's operation is stuck in the waiting for table metadata lock state, any
The default engine used by MARIADB in our own mirror after our CentOS 7+ version is the InnoDB engine:Features of the InnoDB engine:The 1.InnoDB storage engine stores the data in the table space;2. Support Transactions3. Fine lock granularity
One, MySQL installationTo install the MySQL database:Yum install-y MySQL Mysql-serverTo determine if MySQL started successfully:Service mysqld StartSecond, MySQL configuration1. Log in to MySQL:Mysql-uroot-p2. Change the host field in Mysql.user to%:
Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Unknown column ... The great possibility of this exception is that the database is no problem! The key reason is: You pass the argument is a string type, we manipulate the database when
Calculation formula:Mysql: //lng1 represents a point of latitude and longitude, Lat2 Lng2 represents B-point latitude and longitude//a = Lat1–lat2 is two points of latitude difference b = Lng1-lng2 is the difference of two points of longitude //6378
Multi-instance configuration for MySQL
In a physical machine requires multiple test environments, then you need to build a database of multiple instances, multiple instances of the meaning is to run multiple programs, the instance and 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service