hcymysql / slowquery Goto Github PK
View Code? Open in Web Editor NEWSlowquery图形化显示MySQL慢日志工具
Home Page: https://dbaplus.cn/news-11-2520-1.html
Slowquery图形化显示MySQL慢日志工具
Home Page: https://dbaplus.cn/news-11-2520-1.html
容器化部署后,sql_helper 显示 数据库链接错误,无法显示explain信息,及sql优化建议 ,配置文件 slowquery_db_host="127.0.0.1"
slowquery_db_port="3306"
slowquery_db_user="slowquery"
slowquery_db_password="1qazxsw2"
slowquery_db_database="slowquery"
使用的是默认的账户密码,ip地址和端口都修改了,自己创建用户也是一样
现在输入地址直接访问,无安全措施,能否增加一些
大佬,按文档部署遇到以下问题。
运维监控主机环境:centos7.8 mysql5.7.40 php5.4.16
被监控mysql主机环境:centos7.8 mysql5.7.25 percona-toolkit-3.0.12 pt-query-digest 3.0.12
目前,运维监控主机的Mysql sql_db库中mysql_slow_query_review_history,mysql_slow_query_review 表,显示已采集到被监控主机mysql-slow相关记录,但在直接 select sample,db_max from mysql_slow_query_review_history where checksum=${checksum} limit 1 查询报错 ,参考以前issues,检查对于表字段checksum已是varchar类型。 最头疼是,前端页面也查询,展示不到记录。
看http 日志报以下错误。
[Tue Feb 21 09:49:48.523692 2023] [:error] [pid 10716] [client X.X.X.X:52279] PHP Notice: Undefined index: action in /var/www/html/slowquery/slowquery.php on line 4, referer: http://X.X.X.X:/slowquery/slowquery.php
[Tue Feb 21 09:49:48.525082 2023] [:error] [pid 10716] [client X.X.X.X:52279] PHP Notice: Undefined index: dbname in /var/www/html/slowquery/slowquery.php on line 61, referer: http://X.X.X.X:/slowquery/slowquery.php
[Tue Feb 21 09:49:48.525151 2023] [:error] [pid 10716] [client X.X.X.X:52279] PHP Notice: A session had already been started - ignoring session_start() in /var/www/html/slowquery/slowquery.php on line 79, referer: http://10.38.1.200/slowquery/slowquery.php
[Tue Feb 21 09:49:48.525344 2023] [:error] [pid 10716] [client X.X.X.X::52279] PHP Notice: A session had already been started - ignoring session_start() in /var/www/html/slowquery/slowquery.php on line 109, referer: http://10.38.1.200/slowquery/slowquery.php
[Tue Feb 21 09:49:48.526400 2023] [:error] [pid 10716] [client X.X.X.X::52279] PHP Notice: Undefined index: page in /var/www/html/slowquery/slowquery.php on line 113, referer: http://X.X.X.X:/slowquery/slowquery.php
[Tue Feb 21 09:49:48.530640 2023] [:error] [pid 10716] [client X.X.X.X::52279] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /var/www/html/slowquery/slowquery.php on line 152, referer: http://10.38.1.200/slowquery/slowquery.php
很多慢查询可能只是where id=xxx不一样 怎么把这类的sql抽象成一类呢?谢谢
难以部署起来。太多坑了。
以下error如何解决?
2019/05/05 15:47:03 [error] 6539#0: *1509 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: action in /usr/share/slowquery/slowquery.php on line 4
PHP message: PHP Notice: A session had already been started - ignoring session_start() in /usr/share/slowquery/slowquery.php on line 73" while reading response header from upstream, client: 192.168.20.118, server: localhost, request: "POST /slowquery.php?dbname=zabbix&page=1 HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-fpm5.6.sock:", host: "192.168.20.119", referrer: "http://192.168.20.119/slowquery.php?dbname=zabbix&page=1"
2019/05/05 15:47:03 [error] 6539#0: *1509 FastCGI sent in stderr: "PHP message: PHP Notice: A session had already been started - ignoring session_start() in /usr/share/slowquery/slowquery.php on line 103
PHP message: PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /usr/share/slowquery/slowquery.php on line 146" while reading upstream, client: 192.168.20.118, server: localhost, request: "POST /slowquery.php?dbname=zabbix&page=1 HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-fpm5.6.sock:", host: "192.168.20.119", referrer: "http://192.168.20.119/slowquery.php?dbname=zabbix&page=1"
2019/05/05 15:47:03 [error] 6539#0: *1509 FastCGI sent in stderr: "PHP message: PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /usr/share/slowquery/get_graph_data.php on line 24" while reading response header from upstream, client: 192.168.20.118, server: localhost, request: "POST /get_graph_data.php HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-fpm5.6.sock:", host: "192.168.20.119", referrer: "http://192.168.20.119/slowquery.php?dbname=zabbix&page=1"
pt-query-digest 分析 mysql5.7 生成 checksum 包含数字和字母
故 mysql_slow_query_review 和 mysql_slow_query_review_history 需修改字段 checksum
为 varchar(32) 或 char(32)
另外以下字段 default 不应该为 '0000-00-00 00:00:00',建议直接 not null
ts_min
ts_max
感谢大佬维护,给个赞先 !
你好,请问能搞一个docker容器一键部署的吗?
页面中可以选择db,但是在页面中的不同位置,可以看到这几个报错:
Notice: Undefined index: action in /usr/local/apache2/htdocs/slowquery.php on line 4
Notice: session_start(): A session had already been started - ignoring in /usr/local/apache2/htdocs/slowquery.php on line 79
Notice: session_start(): A session had already been started - ignoring in /usr/local/apache2/htdocs/slowquery.php on line 109
Notice: Undefined index: page in /usr/local/apache2/htdocs/slowquery.php on line 113
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /usr/local/apache2/htdocs/slowquery.php on line 152
部署后,页面也能打开 选择数据库后 页面一直是空白的。是哪个环节出问题了吗? 我看数据库里面的室友数据的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.