Mysql database optimization principles to be followed bitsCN.com this is a good mysql database optimization article I have seen on the Internet, the content is very comprehensive!
1. use indexes to Traverse tables faster
The index created by
MySQLSlowLog is used to solve the problem of high usage of MySQLCPU bitsCN.com. but how can I find out which SQL statement is executed for a long time? You can refer to the MySQL Slow Log for details.
First, find the MySQL configuration file my.
Example of setting mysql automatic backup in ubuntu
BitsCN. com1. create the path to save the mysql backup file/mysqldata
# Mkdir/mysqldata
2. create the/usr/sbin/bakmysql file.
# Nano/usr/sbin/bakmysql
Input:
#! /Bin/sh
Name = 'date + %
How to obtain the number of occurrences of a long string in SQL: bitsCN.com
How to obtain the number of occurrences of a long string in SQLFor example, there is a string:
X-BGS-2010-09-15-001
I want to know the number of occurrences of '-', which
In mysql, the sumfloat type uses the decimal point method bitsCN.com
Method 1:The best way is to change the float field to decimal (16, 6 ). Specific Method: you can set a temporary field and accurately copy it with the MySQL keyword binary.
Mysql stored procedure instance bitsCN.com
Because mysql User-defined functions cannot output two or more results, you need to use the mysql stored procedure.
The following is an example.
SQL statement:
Drop procedure if exists 'testguocheng
Sorting varchar types in MySQL bitsCN.com
Varchar sorting in MySQL
During today's development, we encountered the following problem:
In the database table, desc sorts varchar values. However, strange phenomena have emerged .. The data in the table
Cascade, NOACTION, Restrict, SETNULL bitsCN.com in Mysql
Cascade, no action, Restrict, set null in Mysql
Meanings of foreign key constraints on subtables:
If no candidate key is found in the parent table, insert/update is not allowed in the
Basic knowledge about external keys and internal and external connections bitsCN.com
Basic knowledge about external keys and internal and external connections
As the existing company has never used the mysql foreign key (which affects the database
MySQL string type conversion time type bitsCN.com
If the MySQL database uses the varchar (or char) type at a certain time, it is convenient for the system to use it, instead of converting the time type to adapt to different database versions, to
Log_bin_trust_function_creators error solving bitsCN.com
Log_bin_trust_function_creators error solution
The preceding error is reported when mysql establishes a function or procedure locally or remotely.
The test result is that the value of
Mysql regular backup operation bitsCN.com
Mysql scheduled backup
1. create the path to save the backup file/mysqldata
# Mkdir/bak/mysqlbak
2. create the/usr/sbin/bakmysql file.
# Vi/usr/sbin/bakmysql. sh
3. write the following script:
[Python]
#! /
Database Design-primary key design bitsCN.com
In our database design, the primary key of the database table is unavoidable. many may not think deeply about it. the design of the primary key has a great impact on the design of the entire database,
Mysqlamp; gt; query statement bitsCN.com
Mysql> query statement
* Query multiple non-repeated records
Id name
1
2 B
3 c
4 c
5 B
Select id, name from s1 group by name
1
2 B
3 c
5 B
* Query records with the most repeated records
Configuring bitsCN.com on the MySQL master/slave server
MySQL master/slave server configuration
The configuration of the master server (master) is very simple. you only need to modify the two points in the my. cnf configuration file.
Modify the
Ubuntumysql remote connection solution
BitsCN.com
When opennebula 3.8 is configured today, when one start is started, an error indicating that the database cannot be connected is reported,However, you can log on by entering mysql-uroot-p in shell,
MySQL Query data inconsistency problem bitsCN.com
Data inconsistency in MySQL Query
Recently, a very strange MySQL problem occurs. using different select statements to query all datasets is actually different.Number of records. Select * gets four
MySQL regular expression
BitsCN.com
A regular expression describes a set of strings. The simplest regular expression is a regular expression without any special characters. For example, the regular expression hello matches hello.
Extraordinary
Understanding and usage of Mysqlcoalesce () function bitsCN.com
Understanding and usage of Mysql coalesce () function coalesce () explanation: return the first non-null expression in the parameter (from left to right); since there is no nvl ()
The group_concat () function of MYSQL combines multiple rows of the same field data into one data bitsCN.com.
The group_concat () function of MYSQL combines multiple rows and the same field data into a data table. the SQL code of the Access Group
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