Small projects sometimes need to use keyword search relevance sort, with Sphinx appear overkill, with the order of MySQL by against.Method One:
Copy Code code as follows:
SELECT * from articles where (title-like '%keywords% ') or
Objective
In MySQL, the thread exclusive memory is mainly used for each client connection thread to store the exclusive data of various operations, such as thread stack information, packet sorting operation, data read and write buffering, result
A friend recently mentioned how to use SQL to delete a section of a field, so I wrote this article, simple demerit:
The test table is as follows:
Copy Code code as follows:
CREATE TABLE ' t ' (
' ID ' int (a) unsigned not NULL
Data: A db,2000 table, 2000 Tabular data, 30 column per record, and an average of 4.3w records per sheet, totalling 86,388,670 records.
Machine: Linux 64bit 8G memory 4 core Intelx3320@2.5ghz
Basic ideas:
Copy Code code as follows:
When you apply MySQL, you will encounter situations where you cannot create a function. The following error message appears:
Copy Code code as follows:
ERROR 1418:this function has none of deterministic, NO SQL, or reads SQL DATA in
Using rsync to configure a large number of MySQL, save a lot of compilation and configuration time, with the master and slave server to modify the MY.CNF, after the discovery of data can not be synchronized,On slave server Show slave Status:
Fatal
One, 1 CREATE TABLE name (name VARCHAR (10));
For this table, by default, the results of the following two queries are the same:
Copy Code code as follows:
SELECT * from TABLE NAME WHERE name= ' clip ';
SELECT * from TABLE NAME
In web development, we often need to insert data from one table into another, and sometimes we need to specify an import field that only needs to import records that don't exist in the target table, although they can be split into simple SQL in a
A lot of integrated PHP environment (Phpnow WAMP Appserv, etc.) from the MySQL does not seem to open MySQL strict mode, what is the strict model of MySQL, in simple terms is the MySQL itself on the data for strict calibration (format, length, type,
The COALESCE function can accept more than one argument and returns the first Non-null value of those arguments, or null if all the supplied arguments are nullThe Ifnull function, like the COALESCE function, can only accept two parametersThe IF
MySQL database provides two types of indexes, if not set correctly, the efficiency of the index will be greatly compromised but the problem is completely unknown.
Copy Code code as follows:
CREATE TABLE Test (
ID INT not NULL,
Database backup works in use, when the database is a serious error can not start, or data loss in time to effectively recover data. This article briefly describes how to back up and restore the MySQL database.
Backing up a database
Backing up a
Because work requires, write a custom number of MySQL lines, as follows
DELIMITER $$
DROP FUNCTION IF EXISTS ' onlinefunction ' $$
CREATE FUNCTION ' onlinefunction ' (rrrr VARCHAR (50)) RETURNS VARCHAR (255)
BEGIN
IF (rrrr= ' online ') THEN
Explain shows how MySQL uses indexes to process SELECT statements and join tables. can help you choose better indexes and write more optimized query statements.Using the method, add explain to the SELECT statement before you can:
Such as:
Linux can use the crontab system to regularly back up the MySQL database every day, the following are detailed steps:
1, create the path to save the backup file/mysqldata
#mkdir/mysqldata
2. Create/usr/sbin/bakmysql files
#vi/usr/sbin/bakmysql
1. Select statements can be separated by carriage returns
$sql = "SELECT * from article where id=1"
and
$sql = "SELECT * from article
where id=1" can get the correct results, but sometimes it may be clearer to write separately , especially
This article describes the MySQL relocation data Directory implementation method. Share to everyone for your reference. The specific methods are as follows:
MySQL allows you to reposition the data directory or its members, and here's how to
This article summarizes the MySQL export all index and constraints of the method, provided to everyone to facilitate the query use. Specifically as follows:
1. Export Create a self-added field statement:
SELECT
CONCAT (
' ALTER TABLE
This article is mainly about how to use the shell to achieve a full amount of MySQL, incremental backup. Incremental backups are replicated mysql-bin.00000* to the specified directory at Monday-Saturday 3 o'clock in the morning, while full backups
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