1.需要mysql的all权限
2.
加个索引:
ALTER TABLE `tb_qy_learnonline_student`
ADD INDEX `IDX_TQLS_ORG_ID_BELONG_AGENT`(`org_id`, `belong_agent`) USING BTREE;
3.添加索引超时问题解决方法:
1、查看MySQL锁等待时间:SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';(看看是否因为设置锁等待时间太短而导致超时)
2、修改MySQL锁等待时间:SET innodb_lock_wait_timeout=XX(增加锁等待时间,目的是添加索引成功)
3、添加索引
4、成功之后修改MySQL锁为原来时间(保持和原来设置时间一致)
注意:需要晚上执行