Original address:mysql slow log file analysis processing MaxyichaMySQL has a function that can log down to run the slow SQL statement, the default is not the log, in order to enable this function, to modify the my.cnf or when MySQL started to add
Original: MySQL server variable data operation dml-viewcomponents of the SQL languageCommon categories:DDL: Data Definition Language DCL: Data Control language, such as authorization DML: Data Manipulation languageOther categories:Integrity
Recently in the production of an installation package, need to install the time to execute the MySQL script, do a batch, but found that always execute to insert Chinese when the error, or insert Chinese is garbled.Online check a lot of information,
MySQL Query execution processQuery Process :
The client sends a query to the server;
The server checks the query cache first, and returns the results stored in the cache immediately if the cache is hit; otherwise, go to the next stage;
1 in MySQL, the default is not to turn on the slow query log function, we can use show variables like '%slow% ' to see. The results are as follows:650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/26/EA/wKiom1NuKfvDr8nqAAFYiGubJfQ397.jpg
Yesterday wrote a Dongdong, share the next to everyone.Drop PROCEDURE if exists sp_cleanuserdata;CREATE PROCEDURE ' Sp_cleanuserdata ' ()BEGIN/* Define a cursor */DECLARE V_dt bigint (0) default;Declare v_num INT DEFAULT 0; /* cursors are assigned
MySQL can be seen as a two-tier architectureThe first layer of SQL layers, including permission judgment, SQL parsing, Execution plan optimization, query cache processing, and so on;The second tier of storage engine layer (Storage engine layers) is
Data structures for InnoDB tablesInnoDB this kind of engine, and the MyISAM engine difference is very big. In particular, its data storage format and so on.For the data structure of INNODB, there are two conceptual problems to be solved first: the
I. Introduction to Data migrationThe so-called data migration refers to the migration of the original database system to another business systemThe reasons for data migration are varied and may be business changes, hardware upgrades, platform
Implementation from the customer to export the database to me, I in this machine with SQLyog import garbled and error. The error content is no selected database. But I did choose the database.Finally asked the implementation of the buddy, he said he
Use case when for string replacementCopy codeThe Code is as follows: mysql> select * from sales;
9 rows in set (0.01 sec)
SELECT name AS Name,CASE categoryWHEN "Holiday" THEN "Seasonal"WHEN "Sion" THEN "Bi_annual"WHEN "Literary" THEN "Random" end as
Mysql isnull usage
MySQL can use the ISNULL () function. However, it works in a different way than Microsoft's ISNULL () function.
Let's first look at the usage of several is null SQL statements:
Select * from newtable where name is null // obtain
For other mandatory operations, the priority is as follows:
Common hint of mysql
Oracle users may know that there are many types of hint functions in oracle and many methods are provided to optimize SQL statements. Similarly, similar hint functions
It is important for MYSQL database users to back up and restore MySQL. This article describes how to use the mysqldump and source commands to back up and restore MYSQL in Windows and Linux.
I. Restoration of MySQL backup in Win32 System
Backup: In
SQL is an ANSI standard computer language used to access and operate database systems. SQL statements are used to retrieve and update data in the database. SQL can work with database programs, such as MySQL, MS Access, DB2, Informix, ms SQL Server,
During the database table copy and backup operations, we should all know that there are two methods: select into from and insert into select? I will not talk about the differences and usage of the two methods here. If you need them, refer to the
My experiences with MYSQL (1)
My experiences with MYSQL (III)
My experiences with MYSQL (4)
Display width
You can specify the display width for All Integer Data Types in MYSQL, but not for SQLSERVER.
Create a table
tb_emp( id ())
The data
SQL date and time subtraction statement
This tutorial uses the datediff function to perform a subtraction query on the date of the database tutorial. The following describes n methods of mssql date subtraction.
Subtract two dates in SQL
1. Days of
XA transaction support is limited to the InnoDB Storage engine.
MySQL XA is implemented for external XA, where the MySQL server acts as the resource manager and the client program acts as the Transaction Manager. "Internal XA" is not implemented ".
If Character Set problems exist, the following errors may occur:
MySQL connection failed: the character set charset_name cannot be initialized.
Cause of the error:
· The multi-byte character set is not supported by the client. In this case, you
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