11. Add DataAn existing student table is designed as follows:Sno Primary KEY and self-increment, saddress represents the address, set the default value: ' Guangdong province Guangzhou '1. Add a complete insert into tables values (Val1,val2,..., valn)
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
The basic content of the index is described in the previous article, and we continue to introduce the index optimization combat. Before introducing the index optimization practice, first introduce the two important concepts related to indexes, which
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
For the installation steps, a large number of online, I will not repeat, we can degree Niang together, today only talk about the installation process of some pits:1. When authorized by the system user, a log file is generated containing the initial
What is MySQL multi-instance:After we install MySQL, we start the MySQL service through/etc/init.d/mysqld start, a MySQL service is a MySQL instance, when we start multiple MySQL services, it is equivalent to running multiple MySQL instances, this
1, from the OSS download mysql-2018-07-31_22-01-22.tar.gz, Huawei Cloud is too perverted, every second on the 100mb!!2, upload files from the Windows host to the Linux host, through the SFTP protocol, 47MB per second.3. Kill the process that
1. InnoDB consistency Read and lock differences at different isolation levelsUnder different isolation levels, the consistent read policy and the required locks for INNODB processing SQL are different, and the characteristics of the data recovery
We know that for MySQL log function, we can completely control whether to write or not. Generally speaking, binlog we usually open, and for slow queries we generally debug and observe the execution speed of SQL statements at the time of development.
1.1mysql Bin-log LogMySQL's bin-log log is a database statement that records data additions and deletions. As a result, bin-log can be used as a database recovery file, which is also the basis for MySQL's master-slave replication.1.1.1 Turn on MySQL'
I. List of permissionsSelect_priv. Determines whether the user can select data through the Select command.Insert_priv. Determines whether the user can insert data through the Insert command.Update_priv. Determines whether the user can modify
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>
The traditional operations in relational data operations--and (UNION), Cartesian product (Cartesian product), connection (join).1. and (UNION)" and " is to merge tables with the same number of fields and the same field type.Number of records merged =
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
1.1.Basic Operations Database engine
Inodb: Support transactions [atomic operations, complete a number of column operations before the completion of the operation, otherwise rollback]
MyISAM: Supports full-text indexing, emphasizing
Append from MySQL:Scenario: Add 1 from MySQL on a master-slave MySQL basisNote:This mode will lock the table at the time of backup, it is recommended to execute at night when no business is used.Create an account with Sync permissions on the main
1. Role of the index:(1) Improve query speed(2) Improve the sorting speed(3) Increase the speed of group statistics2. Parsing of the index:Explain select * from T4 where a1=3 and A2>4 and a3= 53. Clustered index and non-clustered indexNon-clustered
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%:
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
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