Linux enable MySQL slow query
The code is as follows
Copy Code
Vim/etc/my.cnf[Mysqld]Slow-query-log = on # Open slow query functionSlow_query_log_file =/usr/local/mysql/data/slow-query.log # Slow query log store path and
What is a table partition
A table partition is a large table, divided into several small tables according to the conditions. Mysql5.1 began to support datasheet partitioning.For example, if a user table has more than 6 million records, the table
1.IFNULL statement: Ifnull (EXP1, EXP2), return EXP2 if EXP1 is null, return EXP1 if not null
The code is as follows
Copy Code
mysql> SELECT ifnull (null, 100);+-------------------+| Ifnull (NULL, 100) |+---------------
Three table union queries we can use the following syntax
The code is as follows
Copy Code
SELECT * from a LEFT join B to a.id=b.id left join C on b.id=c.id
Example
Now it's time to list all the users and the
MySQL is divided into two roles
1, master server Master
2, from the server slave
MySQL master-slave replication is the database synchronization between two servers, can also be understood as a backup of the primary server, when the master server
Chinese Pinyin Whole spelling
The code is as follows
Copy Code
--Create a Chinese phonetic control temporary tableCREATE TABLE IF not EXISTS ' T_base_pinyin ' (' Pin_yin_ ' varchar (255) CHARACTER SET GBK not NULL,' Code_
To perform show slave status from the server, you can view a number of synchronization parameters, and we need to pay special attention to the following parameters:Name of the primary server binary log file that the I/O thread in
Mydumper Installation
1, first install CMake, because this software to use CMake compile
The code is as follows
Copy Code
# Apt-get Install CMake
2, the next installation Mydumper compatibility package, this
MySQL Character set: cp1252 West European (latin1), solve garbled problem
Use the virtual host space on the phpMyAdmin operation database, if you see the phpMyAdmin home page on the MySQL character set for cp1252 West European (latin1), when we
Single-table MySQL UPDATE statement:
The code is as follows
Copy Code
UPDATE [low_priority] [IGNORE] Tbl_nameSET col_name1=expr1 [, col_name2=expr2 ...][WHERE Where_definition][Order BY ...][LIMIT Row_count]Update
Like *unix version:
Here is the wrong answer:
First stop the MySQL service and then start it with the Skip-grant-tables parameter:
The code is as follows
Copy Code
Shell>/etc/init.d/mysql StopShell>
First of all, I used Perl to save files in the DBM database with more than 50,000 records and 15 fields per record. Now want to use MySQL, to the record guide over. The first step, all the DBM records are imported into a text file, each field is
Problem Analysis:
1, c:windowstemp folder permissions are not enough, at least to give the USERS group readable and writable permission;
2, C:windowstemp folder full of disk, the file is not written in, empty the TEMP folder;
3, third party
The development of the Web site backend system in the test process, this problem occurs:Invalid query:duplicate entry ' 127′for key 1SQL is:insert into ' kq_news ' (' Title ', ' Author ', ' Type ', ' Content ', ' Isdel ', ' adate ', ' Range ', '
When connecting to the database tutorial show can ' t connect to MySQL Server (10060), Basic can follow the following ideas for troubleshooting:
1. The network is impassability.
Check to be able to ping.
2. Firewall settings.
Whether the
1. Server StatusServer a:192.168.1.1Server b:192.168.1.2
2. Create a synchronization userHost Domain a:192.168.1.2 username a:sync_a password a:aaaHost Domain b:192.168.1.1 username b:sync_b password b:bbbAssign at least the following permissions
In MySql4.0.12, with the "CREATE TABLE Bak_name as SELECT * from Original_name" statement
, the generated Bak table does not have a primary key and the index, the use of the time to pay attention to. You can build a table structure that you want to
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