Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

1 votes
2 answers
97 views
How to set MariaDB to automatically kill long-running SQL queries?
I created a test query to do some counting but five minutes of execution time is ridiculous! So I figured there must be a maximum execution time setting somewhere however the two things I found and tried failed: 1. `max_execution_time = 2` 2. `max_statement_time = 2` I attempted to place these in al...
I created a test query to do some counting but five minutes of execution time is ridiculous! So I figured there must be a maximum execution time setting somewhere however the two things I found and tried failed: 1. max_execution_time = 2 2. max_statement_time = 2 I attempted to place these in all three sections in my my.ini settings file and restarted the MariaDB service on Windows to verify if it worked (it didn't). MariaDB states that it will stop all queries unlike MySQL that only stops SELECT queries. **How do I force MariaDB to terminate long-running SQL queries?** I want to define this in the my.ini setting file; I do *not* want to define this in the command line call. **Update 1:** This update to my registry based command works but I don't want to set this configuration in the command line, it belongs in the configuration file: "C:\MariaDB\bin\mysqld.exe" "--defaults-file=C:\MariaDB\data\my.ini" "--max_statement_time=4" "MariaDB"
John (769 rep)
Jul 11, 2025, 09:44 PM • Last activity: Jul 14, 2025, 02:15 AM
1 votes
1 answers
31 views
How to prevent MariaDB from restarting service on Windows after I've manually stopped it?
I am doing resiliency tests for processes that easily take long enough that the user will just walk away and come back minutes if not hours later. I need to emulate something in my system failing so I can ensure my software will wait a few seconds and make a limited number of attempts to reconnect a...
I am doing resiliency tests for processes that easily take long enough that the user will just walk away and come back minutes if not hours later. I need to emulate something in my system failing so I can ensure my software will wait a few seconds and make a limited number of attempts to reconnect and finish this long-running task. What is not fine is when I manually stop the MariaDB service in Windows it is restarted! I didn't even know it at first except my log viewer was showing database activity, so I pressed F5 and yup, it was started again. Now, yes, I know service recovery is important in most scenarios, but now it's hurting my productivity. I presume there is a setting for the my.ini configuration file though I haven't been able to track down any relevant documentation. There also appears to be no non-default settings in the service properties. How do I prevent MariaDB from restarting the service after I've manually stopped it on Windows?
John (769 rep)
Jul 11, 2025, 05:32 PM • Last activity: Jul 11, 2025, 07:18 PM
0 votes
3 answers
189 views
Upgrading from mariadb 10.11.8 to 11.4.5 gives warning about ERROR 1267 Illegal mix of collations
As title says I upgraded my mariadb, all fine and no issues, ran mariadb-upgrade and all fine but now every time i start mariadb I see this errors Mar 27 03:38:42 db3 debian-start[2408864]: SELECT count(*) FROM mysql.user WHERE user='root' and password='' and password_expired='N' and plugin in ('',...
As title says I upgraded my mariadb, all fine and no issues, ran mariadb-upgrade and all fine but now every time i start mariadb I see this errors Mar 27 03:38:42 db3 debian-start: SELECT count(*) FROM mysql.user WHERE user='root' and password='' and password_expired='N' and plugin in ('', 'mysql_native_password', 'mysql_old_password') Mar 27 03:38:42 db3 debian-start: -------------- Mar 27 03:38:42 db3 debian-start: ERROR 1267 (HY000) at line 1: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb4_unicode_520_ci,COERCIBLE) for operation '=' I have tried changing the mysql.global_priv already and even tried to run this ALTER TABLE mysql.user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; But it gives an error /* SQL Error (1347): 'mysql.user' is not of type 'BASE TABLE' */ This works fine but doesn't fix the issue
TABLE mysql.global_priv CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
Confirmation of the defaults being loaded at start mysqld would have been started with the following arguments: --socket=/run/mysqld/mysqld.sock --pid-file=/run/mysqld/mysqld.pid --basedir=/usr --skip-name-resolve --bind-address=0.0.0.0 --port=REDACTED --collation-server=utf8mb4_unicode_520_ci --init-connect=init-connect=SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci --character-set-server=utf8mb4 --character-set-client-handshake=FALSE --skip-character-set-client-handshake=1 --key_buffer_size=2G --myisam_sort_buffer_size=16M --max_allowed_packet=256M --myisam-recover-options=BACKUP --max_length_for_sort_data=8192 --expire_logs_days=7 --max_binlog_size=100M --max_connections=39000 --max_user_connections=38990 --wait_timeout=10 --back_log=4096 --max_connect_errors=4096 --table_open_cache=40000 --table_definition_cache=40000 --tmp_table_size=1G --max_heap_table_size=1G --innodb_buffer_pool_size=32G --innodb_log_file_size=8G --innodb_read_io_threads=64 --innodb_write_io_threads=64 --innodb_thread_concurrency=0 --innodb_flush_log_at_trx_commit=0 --innodb_flush_method=O_DIRECT --performance_schema=OFF --innodb-file-per-table=1 --innodb_io_capacity=2000 --innodb_table_locks=0 --innodb_lock_wait_timeout=50 --innodb_deadlock_detect=ON --query_cache_limit=0 --query_cache_size=0 --query_cache_type=0 --sql-mode=NO_ENGINE_SUBSTITUTION --log_error=/var/lib/mysql/mysql_error.log --log_queries_not_using_indexes=0 --long_query_time=5 --slow_query_log=1 --slow_query_log_file=/var/lib/mysql/mysql_slow.log --event_scheduler=ON --performance_schema_max_file_handles=999999 My show create table CREATE TABLE global_priv ( Host CHAR(255) NOT NULL DEFAULT '' COLLATE 'utf8mb4_unicode_520_ci', User CHAR(128) NOT NULL DEFAULT '' COLLATE 'utf8mb4_unicode_520_ci', Priv LONGTEXT NOT NULL DEFAULT '{}' COLLATE 'utf8mb4_unicode_520_ci', PRIMARY KEY (Host, User) USING BTREE ) COMMENT='Users and global privileges' COLLATE='utf8mb4_unicode_520_ci' ENGINE=Aria ; I don't know what else to do. This doesn't seem to cause issues when connecting but it's annoying and also seems related to this issue here that had no solution https://dba.stackexchange.com/questions/339213/mariadb-cant-enforce-charset-and-collation-to-clients Anyone knows how to fix this?
Freedo (208 rep)
Mar 27, 2025, 09:36 AM • Last activity: Jun 12, 2025, 05:50 PM
Showing page 1 of 3 total questions