1, please do not use distinct in select; #会用到临时表2, try not to select *, and you should query the specified number of fields that need to be used;3, do not federate on two large tables, either inline or out-of-union. For the case that two or more
MySQL master slave due to ibdata1 full disk space--Master and slave failureBecause innodb_file_per_table is set = 1,ibdata1 is still bursting to fill the disk spaceWhen the master/slave is disconnected, the IO thread is connected and the SQL thread
The most widely used database in Linux is MySQL, which uses online yum to install versions that lag behind several small versions of the MySQL site,So toss for a few weeks, finally in CentOS installed mysql5.6, after loading, to the entire operation
Compressed versionDownload the Oracle website mysql compression packI use 64 bits.1, extract to the specified directory disk such as: C:\mysql\mysql-5.7.10-winx642, new My.ini under Configuration directoryThe contents are as follows:[MySQL]# Set the
1, MySQL synchronization data is contained Server-id, to identify which server the statement was originally written from, so Server-id must have2, each synchronization of the slave on the master has a master thread, the thread is identified by the
http://dngood.blog.51cto.com/446195/1150031
Log_slow_queries =/usr/local/mysql/var/slow_queries.log #慢查询日志路径
Long_query_time = Ten #记录SQL查询超过10s的语句
log-queries-not-using-indexes = 1 #记录没有使用索引的sql
The reason is that
The InnoDB storage engine uses a hashing algorithm to find the dictionary, and its conflict mechanism takes the form of a linked list, and the hash function uses the division hashing method. For a buffer pool page hash table, a page page in the
When you feel a problem with MySQL performance, you will usually look at the current execution state of MySQL and use show processlist to view it, for example:Where the State column information is very important, first look at the meaning of the
To turn on multi-threaded replication, the default key parameters are two:Mysql> Show variables like ' slave_parallel_% ';+------------------------+---------------+| variable_name | Value |+------------------------+---------------+|
The relational database relies on the primary key, which is the cornerstone of the database physical pattern. There are only two uses of the primary key at the physical level:Uniquely identifies a row.As an object that can be effectively referenced
3.6 examples of common queries
Here are some examples of using MySQL to solve common problems.
In some examples, the shop table is used to store the price of each item (item number) of a merchant (dealer. Assuming that each merchant has a fixed
Mysqlbinlog quick traversal of search records
Target: The developer said that there was a data addition, but he did not know where to add it. In addition, the application function should not add such data. In order to find out the source, so I am
Bottom layer of Shopnc Model, bottom layer of shopncmodel
Some time ago, a certain function was implemented, involving the query of data tables. After being tested locally and in the test environment, the process seemed to be smooth, think about
Sort out various SQL statements that are commonly used in mysql
① Statistics are made by day and month, and daily trend changes are required.SQL queries the sum of values of all previous values on a daily (monthly) basis.Implementation: Compare
Import of large MySQL Data Volume and MySQL Data Volume
First: in fact, the best way is to directly use:
Mysqldump-u username-p Password Database Name
In linux, we tested a data import of over 10 thousand rows, totaling 121 MB. In linux, 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