随笔分类 - MySql
摘要:创建游标 首先在MySql中创建一张数据表: CREATE TABLE IF NOT EXISTS `store` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, `count` int(11) NOT NUL
阅读全文
摘要:mysql查看被锁住的表 查询是否锁表 show OPEN TABLES where In_use > 0; 查看所有进程 MySQL: show processlist; mariabd: show full processlist; 查询到相对应的进程 然后 kill id 杀掉指定mysql连
阅读全文
摘要:根据某个字段查找该字段在哪里表中存在 SELECT * from information_schema.columns where TABLE_SCHEMA='数据库' and COLUMN_NAME='列名'
阅读全文
摘要:一、联合索引测试 注:Mysql版本为 5.7.20 创建测试表(表记录数为63188): CREATE TABLE `t_mobilesms_11` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `userId` varchar(255) CHARACTER
阅读全文
摘要:一、基本概念 1.主键、外键、超键、候选键 超键:在关系中能唯一标识元组的属性集称为关系模式的超键。一个属性可以为作为一个超键,多个属性组合在一起也可以作为一个超键。超键包含候选键和主键。 候选键:是最小超键,即没有冗余元素的超键。 主键:数据库表中对储存数据对象予以唯一和完整标识的数据列或属性的组
阅读全文
摘要:初始化测试数据 创建一个测试用的表 create table dept( id int primary key auto_increment , deptName varchar(32) not null unique, salary decimal(12,6) not null, remark v
阅读全文
摘要:/// /// MySqlHelper操作类 /// public sealed partial class MySQLHelper { public static readonly string DBConnectionString = System.Configuration.ConfigurationManager.ConnectionS...
阅读全文