首页 > 代码库 > mysql

mysql

set sql_mode=‘STRICT_TRANS_TABLES‘ 针对输入合法性检测约束。
外键定义:
[CONSTRAINT [symoll]] FOREIGN KEY
[index_name] (index_col_name....information_schema.)information_schema
REFERENCES tbl_name (index_col_name)
[ON DELETE reference_option]
[ON UPDATE reference_option]
reference_option:
RESTRICT | CASCADE | SET NULL | NO ACTION
视图定义:
CREATE  VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADE | LOCAL] CHECK OPTION]

查看当前DBServer是否启用分区
show plugins;
查看Innodb当前事务可能存在的锁:
SELECT * FROM information_schema.INNODB_TRX;
SELECT * FROM information_schema.INNODB_LOCKS;
SELECT * FROM information_schema.INNODB_LOCK_WAITS;

select @@tx_isolation;

innodb_lock_wait_timeout:控制等待时间 50S (动态)
innodb_rollback_on_timeout:设定是否在等待超时时对进行中的事务进行回滚操作 (静态)

mysql