Git Product home page Git Product logo

mysqlmonitor's Introduction

About Me 👋

  • Learning Java,Go 💩
  • https://blog.thekingofduck.com
  • Talk is cheap,show me the code.
  • When I wirting my code, only God and I know what it does. After a while, only God knows.

mysqlmonitor's People

Contributors

kejaly avatar thekingofduck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mysqlmonitor's Issues

mysql 5.0.51a-3 无法连接

Caused by: com.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:114)
at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1342)
at com.mysql.cj.NativeSession.connect(NativeSession.java:157)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)

依赖的jdbc驱动版本不支持了吧,有办法兼容吗

TimeZone问题

本机环境是用PHPStudy安装在Windows 10的MySQL,运行时报错时区的问题

PS E:\Tools> java -jar MySQLMonitor.jar -h 127.0.0.1 -user root -pass 123456

 __  __        _____  ____  _      __  __             _ _
|  \/  |      / ____|/ __ \| |    |  \/  |           (_) |
| \  / |_   _| (___ | |  | | |    | \  / | ___v1.0_ __ _| |_ ___ _ __
| |\/| | | | |\___ \| |  | | |    | |\/| |/ _ \| '_ \| | __/ _ \| '__|
| |  | | |_| |____) | |__| | |____| |  | | (_) | | | | | || (_) | |
|_|  |_|\__, |_____/ \___\_\______|_|  |_|\___/|_| |_|_|\__\___/|_|
         __/ |      https://github.com/TheKingOfDuck/MySQLMonitor
        |___/
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[16:08:05] Try connect to mysql...
java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at net.thekingofduck.MySQLMonitor.main(MySQLMonitor.java:115)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
        at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
        at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2120)
        at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2143)
        at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1310)
        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
        ... 6 more
java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at net.thekingofduck.MySQLMonitor.main(MySQLMonitor.java:161)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
        at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
        at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2120)
        at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2143)
        at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1310)
        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
        ... 6 more

无法连接数据库,同时不能自动启动日志功能

当pymysql的连接语句是db = pymysql.connect(host=host,port=port,user=user,password=password,db=db_name, charset=charset)时不能连接数据库,改为db = conn = pymysql.connect(host='127.0.0.1',port = 3306,user='root',passwd='*******',db ='mysql',charset="utf8")之后可以连接,尝试直接运行第一条代码显示
issue2

当日志功能关闭的时候不能自动开启,显示
issue
查看mysql本身日志文件,发现位于/usr/local/mysql/data/******.log,修改main.py中的log为上述文件地址之后发现可以正常运行。
iusse3

版本:mac10.13.6、Python 3.6.3、mysql8.0.12

%9d 会导致监控退出

先开启监控,然后访问如下链接:

http://localhost/Less-2/?id=111 union select 1 from a %9d --+

出现 %9d会导致监控退出后,需要再次重新启动两次才能再次成功启动...

$ python main.py
[10:48:33]配置解析成功...
[10:48:33]数据库连接成功...
[10:48:33]当前数据库版本为: 5.5.62
[10:48:34]日志状态为:OFF
[10:48:34]正在尝试开启日志模式...
[10:48:35]日志模式已开启...
[10:48:35]日志监听中...
[10:48:35]show variables like '%general_log%'
[10:48:35]show variables like 'general_log_file'
[10:48:35]set global general_log=off
[10:48:35]show variables like '%general_log%'
[10:48:35]show variables like 'general_log_file'

重新启动 python main.py 第一次不行

C:\Github\MySQLMonitor (master -> origin)
$ python main.py
[11:12:13]配置解析成功...
[11:12:13]数据库连接成功...
[11:12:13]当前数据库版本为: 5.5.62
[11:12:14]日志状态为:OFF
[11:12:14]正在尝试开启日志模式...
[11:12:15]日志模式已开启...
[11:12:15]日志监听中...

再次启动才行:

$ python main.py                                
[11:24:34]配置解析成功...                             
[11:24:34]数据库连接成功...                            
[11:24:34]当前数据库版本为: 5.5.62                      
[11:24:35]日志状态为:OFF                             
[11:24:35]正在尝试开启日志模式...                         
[11:24:36]日志模式已开启...                            
[11:24:36]日志监听中...                              
[11:24:36]show variables like '%general_log%'   
[11:24:36]show variables like 'general_log_file'
[11:24:36]set global general_log=off            
[11:24:36]show variables like '%general_log%'   
[11:24:36]show variables like 'general_log_file'

无法连接数据库,windows10

关于时间那一块代码,我建议是strftime('[%H:%M:%S]') + "配置解析失败 请检查格式是否正确...")这样的格式,因为一开始为修改的时候运行不起来。
后面修改完监控起来以后
YY截图20190425224404
,我测试在mysql运行语句看是否成功被监控,但结果并不理想,为监控到哦

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.