Recently, WHEN I was writing the.net Core program, I could not directly view the specific statements of Sql because the database was switched from Sql Server to MySql. With the sharp increase of business volume, the pain was increasing day by day. In order to solve this problem completely, I kept searching on github, StackOverflow and other sites. Try to find a good way.

The search results are mostly like this:

 SHOW VARIABLES LIKE "general_log%";
 SET GLOBAL general_log = 'ON';
Copy the code

Ok, I tried later found that it really works, BUT, I do not have permission to operate mysql computer, my God, this road is blocked ~~~~

The MiniProfiler library has been updated recently

Dotnet Core support is good, finally see hope ~~~

So start integrating. If you’re an asp.net core project, refer to the documentation,

If it’s a console application, follow these steps to get started:

Step 1: install nuget package MiniProfiler EntityFrameworkCore, at present is still alpha version.

Enable EF Core monitoring initialization if you are using EF Core

Copy the code