Pages

Search This Blog

Sunday, October 17, 2010

MS SQL profiler like for mysql

I was looking around a software for MySQL that can work like MSSQL profiler which can monitor the SQL query executed. Finally i found one called Log Monitor which work well for me.


How it's work? Download Log Monitor. Open LogMonitor.jar file.


Connect to MySQL server, open a SQL Query window and run this script



SET GLOBAL general_log = 'ON';



Check on log file location in my.ini file (for windows user) or my.cnf (for linux user).

For windows user,
#Path to the database root
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"

Open Log Monitor and set "log file path" with the file name. 




Now, open another SQL Query window and run any script. You can see the query you run displayed in the Log Monitor.



Hope this help.

Tuesday, October 12, 2010

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Face strange error when try to print report using crystal report.

Server Error in 'xxx' Application.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Source Error:






An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:



[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +271


[Exception: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +333
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +894
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +84
Transaction_InvoicePrint.Print() +149
Transaction_InvoicePrint.Page_Load(Object sender, EventArgs e) +5
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627



I'm not sure what could cause this issue but after i reset iis, everything work fine.

Friday, October 1, 2010

mysql 5.1 data folder / directory / location

I've installed new MySQL 5.1 to replace my MySQL 5.0. I cannot find my data folder. 
Finally, check my.ini file in MySQL 5.1 folder and found line below


datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"


All data folder is in "C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"