随笔分类 - MYSQL
摘要:explain显示了mysql如何使用索引来处理select语句以及连接表。可以帮助选择更好的索引和写出更优化的查询语句。使用方法,在select语句前加上explain就可以了:如:explainselectsurname,first_nameforma,bwherea.id=b.idEXPLAI...
阅读全文
摘要:假设存在组合索引it1c1c2(c1,c2),查询语句select * from t1 where c1=1 and c2=2能够使用该索引。查询语句select * from t1 where c1=1也能够使用该索引。但是,查询语句select * from t1 where c2=2不能够使用...
阅读全文
摘要:MySQL从库上有一个IO线程负责从主库取binlog到写到本地。另外有一个SQL线程负责执行这些本地日志,实现命令重放;一、环境 主机: master操作系统:centos 5.3 IP:192.168.1.2...
阅读全文
摘要:我的mysql安装在c:\mysql一、更改密码 第一种方式: 1、更改之前root没有密码的情况 c:\mysql\bin>mysqladmin -u root password "your password" 2、更改之前root有密码的情况,假如为123456 c:\mysql\bin>mysqladmin -u root -p123456 password "your password" 注意:更改的密码不能用单引号,可用双引号或不用引号第二种方式: 1、c:\mysql\bin>mysql -uroot -p密码 以root身
阅读全文