Today in the operation of the database, found that the data operation error, want to recover, but no transaction, supposedly, set to not default commit transaction, at this time the various operations do not respond to the database. At this point,
Today took time to collate a MySQL in the days, weeks, months of time data related to the SQL statement of the various writing, part of the collection of information, all hand-finishing, their own learning at the same time, share to everyone, and
First, the basic conceptThe mysql5.1 version begins with the introduction of the event concept. Event is not only a "time trigger", unlike the events triggered by the triggers, the event is similar to a Linux crontab scheduled task for time
One or four types of logs1. Error log: Log the start, run, and shutdown process of MySQL server, ending with. Err by defaultMysql> Show variables like ' log_error ';2, binary log * * *Documenting all DDL and DML operations that a user makes to a
The first step is to create the function f_dim_dayCREATE PROCEDURE F_dim_day (in Start_date VARCHAR (a), in Date_count int)Begindeclare i int;Set i=0;DELETE from Dim_day;While IINSERT into
Time turns into years, days and secondsSelect Date_format (now (), '%y%m%d%h%i%s ')Time turns into month and daySelect Date_format (now (), '%y%m%d ')This time last yearSelect Date_add (now (), Interval-1 year)This time last monthSelect Date_add
Because the project needs to create a timer (EVEVT), so Baidu a bit, found that the basic is from a template, some functions are not complete, now summarize their own. Note: The MySQL version is supported for event starting from 5.1. If your version
1. How long is the distance from the current executionDELIMITER $$ALTER definer= ' admin ' @ '% ' EVENT ' epnrupdatestatusagain ' on SCHEDULE every 1 day starts ' 2015-07-24 14:45:00 ' on completion PRESERVE ENABLE do BEGINUPDATE diyfare. ' PNR 'SET
Select Mad.msg_def_name, Mad.msg_def_type,mad.msg_def_content,mad.id,Mad.act_start_date,mad.act_end_date,mad.remark,mad.created_user,masw.name fromMk_act_define Mad Left JOIN (select *,group_concat-sent_way_value = ' SMS ' Then ' text message ' when
String functionsASCII (str)Returns the ASCII value of the first character of the string str (str is empty when the string returns 0)Mysql> Select ASCII (' 2 ');50Mysql> Select ASCII (2);50Mysql> Select ASCII (' dete ');100ORD (str)If the string str
MySQL Event schedule lets you set up your MySQL database to perform the actions you want at some time Create event test1 on schedule every 1 days starts ' 2007-09-01 12:00:00 ' On completion not preserve does insert into yyy values (' hhh ', '
SHOW VARIABLES like ' Event_scheduler '; ==> query Whether the event is turned onSET GLOBAL Event_scheduler = 1;==> Opens the event set Event_scheduler is always on in MY.CNF or My.ini, add event_scheduler=1 or mysqld.--event_scheduler=1
This article provides a detailed analysis of how to use php to obtain the timestamp of today, tomorrow, and yesterday. For more information, see use php to obtain the timestamp of today, tomorrow, and yesterday.
Echo "today:". date ("Y-m-d ")."
";
Various Mysql time functions mysql time functions are rich 1. SQL code SECOND (t. file_time) 2. current Time SQL code now () 3. select DATE_SUB (curdate (), INTERVAL 1 DAY) 4. timestamp default mysql timestamp Field weird problem create table
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.