There is a table, the ID is the primary key, so the writing can return a record:
Copy Code code as follows:
"SELECT * FROM T has id=min (ID);"
But instead of changing min to Max, the return is empty:
Copy Code code as
RegexpExample 1. The query field contains data that is not in English
Copy Code code as follows:
SELECT *
From ' M_user '
WHERE ' Emp_no '
REGEXP ' [^-~] ' =1
Column 2. So I can get all the English-free
Copy Code
MySQL calculates a two-date time difference function Timestampdiff usage:
Grammar:
Timestampdiff (INTERVAL,DATETIME_EXPR1,DATETIME_EXPR2)
Description
Returns the integer difference between a date or datetime expression Datetime_expr1 and
First, the environment description:
Copy Code code as follows:
[ROOT@BEANVM ~]# Cat/etc/redhat-release
Red Hat Enterprise Linux Server Release 6.2 (Santiago)
[ROOT@BEANVM ~]# Uname-a
Linux BEANVM 2.6.32-220.el6.i686 #1 SMP Wed
Use test;
DROP table if exists T8;
CREATE TABLE T8 (S1 int,primary KEY (S1));
drop procedure if exists handlerdemo;
DELIMITER $$
CREATE PROCEDURE handlerdemo ()
BEGIN
declare xx int default 4;
DECLARE oh_no condition for sqlstate ' 23000
In the database, the most significant performance impact includes the database lock policy, caching policy, indexing policy, storage policy, and execution plan optimization strategy.
The indexing policy determines the efficiency of the database to
This two-day project has a problem, limit use after the error.
The demand is like this, I have 3 tables, infor information table, mconfig material configuration table, maaply material request form, request to read out which person in the
1, view log situation
Copy Code code as follows:
Mysql> show global variables like '%log% ';
+---------------------------------+---------------------------------+
| variable_name | Value |
+---------------------------------+------------
Installation Environment: CentOS 5.4MySQL version: MySQL 5.1.xx with rpm direct installationRequired Software: Xtrabackup 1.2.22 with RPM direct installation1. master:/etc/my.cnf
Copy Code code as follows:
[Mysqld]
Server-id = 1
Many times the site based on the php+mysql of the system can appear in the bottleneck is often out of MySQL, and MySQL in the most of the statements are query statements, therefore, for MySQL database query statement optimization is very important!
MySQL log system online for some time, the front end in the slowly cut the site to write, proactive DIY set of MySQL monitoring tools.
Divided into slave status, Sync,objec infot,userprivileges,job status, Slowlog.
This time, Slow_log.
MySQL 1.5
1, the slow log status;
Mysql> Show variables like '%slow% ';+---------------------+------------------------------------------+| variable_name | Value |+---------------------+------------------------------------------+| log_slow_queries | On ||
MySQL add field:
ALTER TABLE ' User_movement_log '
add column Gatewayid int not null default 0 after ' RegionID ' (added after which field)
To delete a field:
ALTER TABLE ' user_movement_log ' drop column Gatewayid
To
Method 1: Using the Set password command
Copy Code code as follows:
Mysql-u Root
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');
Method 2: With Mysqladmin
Copy Code code as follows:
Let's share the following, the way to close the MySQL log
LNMP a key package installed MySQL default open MySQL log, if the site on the database read and write more frequently may generate a large number of logs, and occupy disk space, but also may
MySQL Index overview
All MySQL column types can be indexed. Using indexes on related columns is the best way to improve the performance of select operations. Defines the maximum number of indexes and the maximum index length per table based on the
Microsoft's Visual Studio does not have its own driver to connect to MySQL, to download a mysql-connector-net-6.4.3 driver on the Internet, and then install it to use.
The following is a class that I encapsulate to connect the database, call
First, what is the MySQL table and partition
What is a table, from the superficial point of view, is to divide a table into n multiple small tables
What is partitioning, partitioning is to divide the data of a table into n multiple chunks that can
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