MySQL event scheduler waiting on empty queue since server restarted 12 days ago

I noticed a process on the server which has been running for more than 12 days, which I think coincides with the last time MySQL was restarted.

mysql> SHOW FULL PROCESSLIST;  +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ | Id      | User            | Host      | db   | Command | Time    | State                  | Info                  | +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ |       5 | event_scheduler | localhost | NULL | Daemon  | 1098372 | Waiting on empty queue | NULL                  | | 1774483 | root            | localhost | NULL | Query   |       0 | starting               | SHOW FULL PROCESSLIST | +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ 2 rows in set (0.00 sec) 

There are no events, and I haven’t attempted to created any.

mysql> SELECT * FROM information_schema.EVENTS;  Empty set (0.00 sec) 

This is actively using up to 8% of my server’s CPU.

Is there a way of determining what this is, or why it was started? Will this try to run every time I restart MySQL? If so, what is it ‘waiting’ for and do I need to tweak my configuration at all to prevent this?

MySQL 8.0.21

Disable password policy for partially-contained database SQL Server

I’m stuck in a situation where I need to create a new user for a partially-contained database (SQL Server 2016). The password is short, so I get an error:

Password validation failed. The password does not meet Windows policy requirements because it is too short. 

When creating a login at the instance level, there is an option to untick ‘Enforce password policy’, ‘Enforce password expiration’, and ‘User must change password at next login’. There is no such option when creating a user for a partially-contained DB.

Is there a way to get around this?

Thanks

Connect to Ms SQL Server

I’ve been asked to develop custom plugins which will connect to a database hosted on MS SQL Server in different geographical location, i.e the website is hosted with a hosting service and the database is hosted within the businesses office. I have no idea how to go about remotely connecting the SQL server. Any advice people may offer would be greatly appreciated.

Why is MEMORYCLERK_SQLGENERAL using so much memory in SQL Server?

I have a production system running SQL Server 2019 Standard edition. It recently had a problem 3 times in 1 day where it became unresponsive until a reboot. Errors seem to point to memory limitations. 32GB is installed and the machine is dedicated to MSSQL. Max Memory set to 26GB.

The best lead I have so far is output of dbcc memorystatus that was automatically dumped to the log along with a FAIL_PAGE_ALLOCATION error. The full output is attached, but this part below caught my eye. It looks like MEMORYCLERK_SQLGENERAL wanted so much memory that it forced normal things like the buffer pool and query memory down to uselessly small levels.

I can’t seem to find any good info on what MEMORYCLERK_SQLGENERAL does, let alone why it would want so much memory.

11/18/2020 15:10:48,spid51,Unknown,MEMORYCLERK_SQLGENERAL (node 0)                  KB Pages Allocated                            22821672 SM Committed                                      0 SM Reserved                                       0 Locked Pages Allocated                       546740 VM Committed                                  75776 VM Reserved                                12867644 ---------------------------------------- ---------- 11/18/2020 15:10:48,spid51,Unknown,MEMORYCLERK_SQLBUFFERPOOL (node 0)               KB Pages Allocated                                3400 SM Committed                                      0 SM Reserved                                       0 Locked Pages Allocated                            0 VM Committed                                      0 VM Reserved                                       0 ---------------------------------------- ---------- 11/18/2020 15:10:48,spid51,Unknown,MEMORYCLERK_SQLQUERYPLAN (node 0)                KB Pages Allocated                                3632 SM Committed                                      0 SM Reserved                                       0 Locked Pages Allocated                            0 VM Committed                                      0 VM Reserved                                       0 ---------------------------------------- ---------- 11/18/2020 15:10:48,spid51,Unknown,MEMORYCLERK_SQLQUERYEXEC (node 0)                KB Pages Allocated                                1128 SM Committed                                      0 SM Reserved                                       0 Locked Pages Allocated                            0 VM Committed                                      0 VM Reserved                                       0 

SQL Server Nested views, how deep is too much?

I stumbled on a problem using views. The content management system my program interfaces with, defines a view which calls another view on the system. That is 2 levels to begin with. Before I stumble on views, I thought nested views were casual, but after my code blew up and i googled around, i begin to pick up words like "sin" and "vulgar" and "bad" which are associated with nested views.

Well I have two-level nested views to begin with. In my application level, I define my 3rd level and that’s when it gives me time out error. Is 3 level too much? The tables are not terribly big — between 5,000 and 100,000 records, while my view itself only produces 2,000 record. Is this suppose to break the camel’s back?

Free Drive Space and SQL Server Agent Alerts

I need to receive an email when free drive space on E: or H: becomes less than 20%

I know that can be achieved by setting up a job that executes PowerShell or T-SQL scripts on a schedule, that checks for free drive space and sends an alert email when drive space is low

But the question is – can same task be achieved using just an Alert ?
There is alert type "SQL Server performance condition alert"

Is there an Object / Counter that can help to check for drive space and fire this alert if its value "Falls Below" specified threshold ?

Alert

What could cause SQL Server to deny execution of a SP at first, but allow it later with no privileges change?

A user just complained he was denied the execution of a procedure. I went to check and verified he had the privileges to execute it. I didn’t change anything (and right now I’m the only one with admin privileges do to so if needed) and after two unsuccessful attempts he tried to run the SP for the third time and it worked.

I have XE configured to catch error messages and it captured twice the error code 229:

The EXECUTE permission was denied on the object ‘storedProcedureName’, database ‘databaseName’, schema ‘schemaName’.

Is there any situation where this behavior is expected?


Microsoft SQL Server 2014 (SP3-CU-GDR) (KB4535288) – 12.0.6372.1 (X64)

Can’t add any menu items on live server (no item list)

I can’t add any items to menus on live server (can’t even see items to add list – there is list of dropdown "titles" like posts, pages, custom post types etc, but when I expand it – list is empty).

Locally it works. Another weird thing is that if I add items to menu locally and export whole wordpress installation with AIO WP Migration to live server, items are there, added to menu. But I still can’t add any other items (on the live server).

Any ideas what is going on? As I said, I have EXACTLY the same site on live server as I’m having locally (exported with AIO WP Migration), but still can’t add menu items on live server, while locally I can…