One, MySQL query optimizer1. mysql has an optimizer module dedicated to optimizing the SELECT statement, the main function: through the calculation of statistical information collected in the analysis system, the client's Query to provide him with
1 Pre-installation checksTo check if MySQL is already installed on your Linux system, enter the command to try to open the MySQL service:When you enter a password, the following prompt indicates that MySQL is already installed in the system:If this
ZhuqzLinks: https://www.zhihu.com/question/19719997/answer/81930332Source: KnowCopyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.The first optimization
1. sudo apt-get install Mysql-server2. sudo apt-get install mysql-client3. sudo apt-get install Libmysqlclient-devDuring installation, you will be prompted to set a password or something, note that the settings do not forget that after the
1.select_type Simple: It represents a single select, with no union and sub-queryDependent union:union dependent outer-layer queryDependent subquery:subquery dependent outer-layer query2.typeSystem: Table has only one row, this is a const type of
Multi-Table query: (data collection in multiple tables into a table)SELECT user_name as ' nickname ', Gname as ' game name ', score as ' fraction 'From Users,games,scoresWHERE USERS. User_qq=scores. User_qqand games. Gno=score. GNOConnection query:
CentOS7 default database is MARIADB, configuration and so on is not used to, so decided to change to MySQL, but the CentOS7 yum source default seems to be no MySQL. To solve this problem, we need to download the MySQL repo source first.1. Download
[Email protected] ~]# [[email protected] ~]# [[email protected] ~]# gcc-v See if GCC is installed if an error is not Installation[[email protected] ~]# yum-y install GCC installation gcc[Email protected] ~]# wget http://downloads.sourceforge.net/
We often have SQL records that look at MySQL server execution. Support is provided after MySQL5.1, by adding the-L or--log options at startup:Mysqld-lmysqld--logIn later versions (5.1.2), start using--general_log instead:Mysqld--general_logWhen
1, MySQL master-slave replication scheme with Scp/rsync and other commands such as file-level replication is similar to the remote transmission of data. It's just that MySQL comes with this feature without the use of third-party software.2, its
Recently, because of the need to use MySQL, and then according to the old boy's "with the old boy Learning Linux operation--web Cluster practice" to build some problems in MySQL, in the initial study, It is recommended that you complete the
The following employee table employees are available:The table SQL is built as:CREATE TABLE ' Employee ' (' id ' int (one) is not NULL,' Name ' varchar (DEFAULT NULL),' Salary ' int (one) DEFAULT NULL,' DeptID ' int (one) DEFAULT NULL,' Age ' int
Download the MySQL-5.7.19 version, unzip it and discover that the installation package is not an EXE file:So the online search for information, found another way to install.1. Create a new environment variable, my
First, download the installation package for the MySQL database: Mysql-5.7.17.msi. (Baidu, please do it yourself)
Then click here, aha haha haha haha.
-------------------------------------------------------------------------------------------A
Solve the problem that IN subqueries IN MySQL will cause indexing failure. mysql Index
Today, I saw an IN subquery optimization case for MySQL,
At first, I felt a bit skeptical (if it was done in SQL Server, this situation is absolutely impossible,
CentOS 6.6 source code compilation and installation MySQL 5.7.18 tutorial details, centos5.7.18
1. Add users and groups
1. Add a mysql user group
# groupadd mysql
2. Add a mysql user
# useradd -g mysql -s /bin/nologin mysql -M
2. Check whether
How to deduplicate MySQL and how to sort out MySQL
How to deduplicate MySQL
Primary: there are very few duplicate rows.
Use distinct to find out and delete one row manually.
[Intermediate] deduplication Based on the repetition of a single Field
For
Description of JSON operation functions in Mysql5.7, mysql5.7json
Preface
JSON is a lightweight data exchange format, which uses a language-independent text format, similar to XML, but easier to read and write than XML. It is easy for machines to
Mysql exists and not exists instances
Mysql exists and not exists instances
TableA
| Column1 | column1 | column3 |
Tableb
| Column1 | column1 | column3 |
To query the data of tableA, the condition is that tableA. column1 is not in tableB.
Solve the problem that Mysql cannot contract because the transaction log and log file are too large.
1. ms SQL SERVER 2005
-- 1. Clear logsExec ('dump TRANSACTION database name WITH NO_LOG ')-- 2. truncate transaction logs:Exec ('backup LOG database
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.