查看负担重的sql
mysql> show processlist;
// 或者
mysql> show full processlist
清除mysql查询
mysql> kill 查询ID
添加索引
mysql> ALTER TABLE tableName ADD INDEX IndexName (`columnName`);
删除索引
mysql> DROP index indexName ON tableName;
sql语句分析
mysql> explain sql语句
mysql57修改用户密码
-- 更改用户密码
update mysql.user set authentication_string=PASSWORD('[userPassword]') where user='[username]';
-- 刷新权限表
flush privileges;
mysql57权限
-- 查看用户权限
show grants for [userName];
-- 创建用户并给予所有权限
GRANT ALL PRIVILEGES ON [dbName].* to [userName]@'[hostName]' identified by '[password]';