MySQL log:140614 9:45:36 [Note] Plugin ' federated ' is disabled.140614 9:45:36 innodb:the InnoDB memory heap is disabled140614 9:45:36 innodb:mutexes and rw_locks use Windows interlocked functions140614 9:45:36 innodb:compressed tables use zlib 1.2.
Create a TriggerGrammar:Create TRIGGER Trigger NameCreate trigger Xiaoshou_update_trigger after update on Xiaoshou for each row begin update Jiangjin set xiaoshouer= (select SUM (Taoshu*danjia) from Xiaoshou where Userid=new.userid and
Union is simple enough to combine the result set of two SQLSyntax: SQL1 UNION SQL2Present a price listRequirements: Find the price below 2000 and the price is higher than 3000 goods, can not use OR and not Between......andidea: We can find a product
When you do the permissions, you find the permissions for the roles in the Auth permissions through the Roleid in role roles.SQL statements:
SELECT AuthName from Auth where authId in (1,2,3,4,5)
In the back of the thing is the role of
MySQL Custom sort orderExample: Adding an ORDER by FIELD (status,3,4,0,2,1) statement to a SQL statement defines the sort orderSELECTtsdvoucher0_. voucher_id asvoucher1_0_, Tsdvoucher0_.comment_device_type ascomment2_0_, tsdvoucher0_.comment_id
1. If NULL is returned 0Select Ifnull (null,0)2, if NULL returns 0, otherwise returns 1Select if (IsNull (col), 0,1) as Col.Ifnull function Ifnull (EXPR1,EXPR2) in MYSQLIf EXPR1 is not Null,ifnull () returns EXPR1, it returns EXPR2. Ifnull ()
MySQL Lock:There are many types of locks inside MySQL, which can be divided into two categories depending on the purpose:1. Lock that protects the memory structureThe server layer is basically protected with Mutex,rwlock for thread-shared
Open Navicat MySQL management toolConnecting to a databaseSelect Test DatabaseClick QueryEnter the corresponding SQL commandCreate TableTuser (unamevarchar( -) not NULL Primary Key, Upwdvarchar( -) not NULL );Create TableP_info (Pkeyvarchar( the)
# Count the data and index size of all tables in the specified Architecture# Tablesize. sh#! /Bin/sh# Ocpyang@126.com
If ["$ #"-gt 2]; thenEcho "**********************************"Echo "too wrote input parameters"Echo "*******************************
Mysql (5.5) supports DATETIME, TIMESTAMP, DATE, TIME, and YEAR.
Comparison of several types is as follows:
Date and Time Type
Occupied Space
Date Format
Minimum value
Maximum Value
Zero value representation
DATETIME
I recently encountered a requirement involving the stored procedure, and was suddenly asked how to synchronize the problem. I have to make up a lesson to learn more.
First, let's take a look at the definitions of trigger, procedure, and
Customize a mysql STARTUP script according to the working environment
--- 1. Save As/usr/local/mysql/scripts/mysql_env.ini
# Set mysql init variablesMYSQL_USER = system # mysql UsernameMYSQL_PASS = 'Password' # mysql logon User password
# Check
Editor's note: From the Perspective of smart818, the effect of thread pool on performance is indeed very large, and mariadb can even be regarded as the mysql Enterprise Edition. The following high concurrency test shows that the performance of MySQL5
1. Connect to MYSQL.Format: mysql-h host address-u user name-p User Password1. Connect to MYSQL on the local machine.First, open the DOS window, enter the mysql \ bin directory, type the mysql-u root-p command, and press enter to prompt you to enter
Let's take a look at the width range of integer data types.
Create a table
Copy codeThe Code is as follows:Create table tb_emp (id BIGINT (1 ))
The data type of the id field is BIGINT (1). Note the following number 1, which indicates the display
I used to write a stored procedure on MSSQL. I have never written or used it on MYSQL. I need to use MYSQL today, write a part of the stored procedure required by the project and summarize the work. The database structure is not provided here. I
Scheduled execution script:1. Execute
Crontab-e
00 00 ***/bin/bash yourpath/mysqlbak. sh2. Open the automatic execution file vi/etc/crontab and add the following content to etc to enable it to automatically execute the task. 00 00 *** root/mysqlbak.
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