Database query return no data related to remote pc

Sep 17, 2014 at 11:11 AM
Hi,
when I run winaudit (latest version) from a remote pc with command line like:
WinAudit.exe /r=gsoPxuTUeERNtnzDaIbMpmidcSArCOHG /f=Driver=MySQL ODBC 5.3 ANSI Driver;SERVER=yyy;UID=root;PWD=xxx;DATABASE=WinAudit;PORT=3306;/l=log.txt
I have a log like:
...
Records inserted: 1566, error count: 0, time taken: 671ms
...
but when i query the database I have no data related to the remote PC.
Any suggestion?!?

tnx in advance.

Red.
Coordinator
Sep 17, 2014 at 1:59 PM
Hi RedErik,

Hmm...you should only see the success message if MySQL ODBC driver told WinAudit all went well. How did you query the database? WinAudit has a basic report generator. If you haven't tried already, at the GUI, start the logger (Help -> Stat Logging) then File -> Database -> Export -> Adminstration. In the "Reports" section check "Show SQL". From the drop down list select "Counts of Audits by Computer" the click Run. When prompted for credentials, if possible, use the same as you did on the command line. What do you see? Close the dialogue and check the Log tab for any errors/warnings.

Oldbury
Sep 18, 2014 at 10:12 AM
Edited Sep 18, 2014 at 10:38 AM
Hi Oldbury,
I tried the log and grabbed the SLQ Query. When I execute the same query with MySQL Workbench I have no data too
but the log at client states everything worked fine.
Really no idea..in the log file from the client you find a strange SQL 502 error but...

The Computer_ID for this computer is: 1.
2014-09-17 12:59:22 Information Applicazion 0 SQL: {call pxs_sp_insert_audit_master( '{3AAE6895-BCEE-4BDF-8EB9-02F1AE18B8C3}', 'root', '2014-09-17 12:59:22', '2014-09-17 10:59:22', 1 ) }
2014-09-17 12:59:22 Information Applicazion 0 Odbc::ExecDirect: '{call pxs_sp_insert_audit_master( '{3AAE6895-BCEE-4BDF-8EB9-02F1AE18B8C3}', 'root', '2014-09-17 12:59:22', '2014-09-17 10:59:22', 1 ) }'
2014-09-17 12:59:22 Information Applicazion 0 Odbc::ExecDirect: 'SELECT Audit_ID FROM Audit_Master WHERE Audit_GUID = '{3AAE6895-BCEE-4BDF-8EB9-02F1AE18B8C3}''
2014-09-17 12:59:22 Information Applicazion 0 The Audit_ID for this audit is: 5.
2014-09-17 12:59:22 Information Applicazion 0 SQLSetStmtAttr SQL_SUCCESS_WITH_INFO: '[MySQL][ODBC 5.3(a) Driver][mysqld-5.6.14-log]Option value changed to default static cursor SQL State: 01S02 Native Error: 502 ________________________________ Errore Numero: 1 [SQL_SUCCESS_WITH_INFO].'.
2014-09-17 12:59:22 Information Applicazion 0 Odbc::ExecDirect: 'SELECT * FROM Audit_Data WHERE 1 = 2'
2014-09-17 12:59:22 Information Applicazion 0 Odbc::ExecDirect: 'UPDATE Computer_Master SET Last_Audit_ID=5 WHERE Computer_ID=1'
2014-09-17 12:59:22 Information Applicazion 0 Records inserted: 1566, error count: 0, time taken: 671ms
2014-09-17 12:59:22 Information Applicazion 0 Disconnecting from database.
!
!Logging stopped.
!

Red.
Coordinator
Sep 18, 2014 at 11:54 AM
Hi Red,

I don't understand where the records have gone. MySQL is using defualting to a static cursor so SQL State: 01S02 Native Error: 502 is fine.

Some things to check:
  1. In the log file what is the Completion Connection String?
  2. Using MySQL Workbench view the Computer_Master table. For the row with Computer_ID=1 the Last_Audit_ID field should be 5.
  3. View the Audit_Master table. For the row(s) with Computer_ID=1 the maximum Audit_ID field should be 5.
  4. View the Audit_Data table. Are there any rows with Computer_ID=1 and Audit_ID=5?
  5. When you run the report "Counts of Audits by Computer" at the GUI how may rows do you get back?
  6. What is the SQL shown in that report?
    7.What is the SQL shown in the log file. Its the Description begining wth ODBC:ExecuteDirect:.....
Of course, if you have subsequently sent new data to the database, the Audit_ID will be no longer be 5. Look for the log line:
The Audit_ID for this audit is: X to get the new Audit_ID

Regards
oldbury