1. 如何发现有问题的SQL? 使用mysql慢查询日志对有效率问题的Sql进行监视 (1) show variables like 'slow_query_log'; 查看慢查询日志是否开启 (2) set global slow_qeury_log_file = '/home/mysql/sql_log/mysql_slow.log' 设置慢查询日志文件的位置 (3) set global log_queries_not_using_indexes = on 把没
这篇承接上一篇<mysql必会sql语句>:http://blog.csdn.net/qq_32059827/article/details/51763950 这一篇属于加强版,问题和sql语句如下. 创建users表,设置id,name,gender,sal字段,其中id为主键 drop table if exists users; create table if not exists users( id int(5) primary key auto_increment, name var