大家好,以下是我在学习中获取的一些小知识,在这里,和大家进行分享,详情请看:
(一)
-- ===============================================================
-- mysql root 管理软件 -- =============================================================== 监控并发软件:Mysql slap -- =============================================================== -- 查询数据库的字符集合 -- =============================================================== select distinct table_schema,table_collation from information_schema.TABLES where table_schema not in ('performance_schema','sys','test','mysql','information_schema'); select distinct table_schema,table_collation, table_name from information_schema.TABLES where table_schema not in ('performance_schema','sys','test','mysql','information_schema') ; -- 修改表的字符集 alter table cam.account charset utf8; -- 建库 delimiter $$ CREATE DATABASE `csf_fdp` /*!40100 DEFAULT CHARACTER SET utf8 */$$(二)-- =============================================================== -- 设置mysql slow log 开启select语句检测 -- =============================================================== long_query_time = 1 log-slow-queries = /usr/local/mysql/data/slow.log log-queries-not-using-indexes
在线关闭slow log set global slow_query_log='off'; show variables like '%slow%'; SELECT * FROM `test`.`report_data` order by rpt_post_time desc limit 10,100000; -- slow log 没有写入记录在线开启slow log set global slow_query_log='on'; show variables like '%slow%'; SELECT * FROM `test`.`report_data` order by rpt_post_time desc limit 20,100000; -- slow log 有写入记录5.1.40以上肯定支持的,set global slow_query_log='off'; set global slow_query_log='on'; 以上的知识是不是有帮助到大家呢··