随笔分类 - mysql
所有sql的运行环境为mysql5.7版本,演示数据库:http://downloads.mysql.com/docs/sakila-db.zip
摘要:mysql 演示数据库:http://downloads.mysql.com/docs/sakila-db.zip 以%开头的LIKE查询不能够利用B-tree索引 explain select * from actor where last_name like '%NI%'\G; explain
阅读全文
摘要:mysql 演示数据库:http://downloads.mysql.com/docs/sakila-db.zip 匹配全值 explain select * from rental where rental_date='2005-05-25 17:22:10' and inventory_id=3
阅读全文
摘要:版本大于5.5 [mysqld]下添加的应该为: character-set-server=utf8 collation-server=utf8_general_ci 版本小于5.5 [client]下添加: default-character-set=utf8 [mysqld]下添加: defau
阅读全文
摘要:explain select * from film where rating>9\G; possible_keys 从左到右,性能由最差到最好 ALL:全表扫描 index:索引全扫描 range: 索引的范围扫描 用于<,<=,>,>=,between等操作 ref:使用非唯一索引扫描或者唯一索
阅读全文
摘要:1 将未建立索引的sql放到慢查询日志中 查看 log_queries_not_using_indexes 是否为on show variables like 'log%'; 将 log_queries_not_using_indexes 设置为on set global log_queries_n
阅读全文
摘要:进入 /usr/share/mysql 将my-medium.cnf 移动到etc 并且改名为my.cnf
阅读全文
摘要:软件下载 以centos 64位,mysql5.5为例。 下载mysql5.5 网址:http://dev.mysql.com/downloads/mysql/5.5.html#downloads 下载下图箭头所指的三个文件 卸载已经安装的MYSQL 1、查找以前是否装有mysql 命令:rpm -
阅读全文
摘要:修改/etc/my.cnf 2)在[mysqld]下加入一行:lower_case_table_names=1 3)重新启动数据库即可。
阅读全文
摘要:1 修改MySQL的登录设置 # vi /etc/my.cnf 在[mysqld]的中加上一句:skip-grant-tables 2 重新启动mysqld # /etc/init.d/mysqld restart Stopping MySQL: [ OK ] Starting MySQL: [ O
阅读全文

浙公网安备 33010602011771号