charles-001 / dolphie

Your single pane of glass for real-time analytics into MySQL/MariaDB & ProxySQL
https://pypi.org/project/dolphie/
GNU General Public License v3.0
651 stars 40 forks source link

Issue when monitoring mariadb #21

Closed sarthaksingh-tomar closed 1 year ago

sarthaksingh-tomar commented 1 year ago

Hello Guys, I am trying dolphie with Mariadb 10.4 version and it unable to connect it and throwing below exception. That's maybe due to column alias name prefixed with @@.

root@522086de7808:~# dolphie --host=rds-host-name --user=root --password=xxxxxxx --use-processlist
  Dolphie🐬                                                                                                                                                 

  Error                                                                                                                                                     
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
  Failed to execute query                                                                                                                                   

  /* dolphie */ SELECT @@server_id AS @@server_uuid                                                                                                         

  You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@@server_uuid'   
  at line 1                                                                                                                                                 

I have tried running same query without @@ which is running fine.

mysql> SELECT @@server_id AS @@server_uuid;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@@server_uuid' at line 1
mysql> SELECT @@server_id AS server_uuid;
+-------------+
| server_uuid |
+-------------+
|  1573754117 |
+-------------+
1 row in set (0.22 sec)
charles-001 commented 1 year ago

Hi @sarthaksingh-tomar - can you do me a favor and try the changes I just pushed to main?

  1. git clone
  2. curl -sSL https://install.python-poetry.org | python3 - (if you don't have it already installed)
  3. poetry install
  4. poetry run dolphie

Also - not sure how far I want to take support for MariaDB. I may drop it altogether since I don't use it.

sarthaksingh-tomar commented 1 year ago

Thanks @charles-001 , i have tried but now failed due to incompatibility.

  Error                                                                          
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
  Failed to execute query                                                        

  /* dolphie */                                                                  
          SELECT                                                                 
              IFNULL(TIMESTAMPDIFF(                                              
                  SECOND,                                                        
                  MIN(APPLYING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP),           
              NOW()), "0") AS Seconds_Behind_Master                              
          FROM                                                                   
              performance_schema.replication_applier_status_by_worker            
          WHERE                                                                  
              APPLYING_TRANSACTION != ''                                         

  Table 'performance_schema.replication_applier_status_by_worker' doesn't exist  

but anyway that's really nice monitoring tool for Mysql

charles-001 commented 1 year ago

Yeah, there's probably quite a few incompatibilities. Sorry about that! Maybe someone will create a PR to add support in the future :)

charles-001 commented 1 year ago

Hi @sarthaksingh-tomar - just wanted to let you know someone just submitted a PR to support MariaDB 10. Please retry when you have a chance.