14,629 questions
0
votes
1
answer
25
views
MariaDB / XAMPP: "Table '.\mysql\proxies_priv' is marked as crashed and last repair failed" — fixed by manually repairing Aria tables
I ran into an issue where MariaDB in XAMPP refused to start and showed this error:
Table '.\mysql\proxies_priv' is marked as crashed and last (automatic?) repair failed
Fatal error: Can't open and ...
1
vote
1
answer
77
views
Function definition in mariadb 10.11.13 syntax error - typical message for a missing semicolon, but the semicolon is there [closed]
DELIMITER //
CREATE FUNCTION total_cost_for_customer (
custNumber INT
)
RETURNS INT
DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE total INT;
SELECT SUM(unitPrice)
INTO total
FROM ...
2
votes
0
answers
98
views
QSqlQuery in Qt6: in-place vs prepared
First of all, Qt version is 6.10.0, testing on Arch Linux rolling. I think I've found a bug in Qt but maybe it's just my fault.
My program asks MariaDB database for some data and displays it in ...
Advice
0
votes
2
replies
37
views
Remote access to Xampp (mariadb)
I would like to store data remotely in a MariaDB (Xampp) running on Ubuntu. It is running on a totally isolated LAN - no external connection.
I have been looking at various places, but seem to be more ...
1
vote
2
answers
75
views
How do I use a json array to search and extract matched values from a different json array in mariaDB?
Situation
I have two tables. ing_master is a master list of ingredients; pdet is a product table, with an ingredients field formatted as json array.
For each product's ingredient list in pdet, I want ...
3
votes
1
answer
101
views
Cause of and means to avoid "flat BNL join" in mariadb 10.11
I'm trying to help a user in another stackoverflow question and have bumped by head into a strange behaviour.
As I rarely use MariaDB, I'm opening another question to investigate the behaviour,
...
1
vote
4
answers
214
views
Correlated queries without the LATERAL keyword
I am using MariaDB v10.11.15 (a MySQL fork) which does not support the LATERAL keyword, to lookup the countries of 30 IPv4 numbers. I have the following query that retrieves the country when given an ...
Advice
0
votes
6
replies
96
views
Why MariaDB doesn't use newly added index?
MariaDB version is 10.4.34.
The query looks like:
SELECT bet.*
FROM Bet bet
WHERE bet.placed >= '2025-10-29T00:00:00'
AND bet.placed <= '2025-10-29T23:59:59'
AND EXISTS (
SELECT 1 FROM ...
1
vote
2
answers
34
views
mariadb debian-start script giving errors: ERROR 1146 (42S02) at line 1: Table '_cdfd7a1251c20c3e.tabError' doesn't exist
I'm getting a number of these errors printed in the systemd journal when i restart mariadb:
Nov 07 17:56:05 p2 /etc/mysql/debian-start[8427]: --------------
Nov 07 17:56:05 p2 /etc/mysql/debian-start[...
1
vote
0
answers
56
views
Why does fetch performance degrade over time in JBoss with MariaDB and how to properly configure fetch for direct JDBC Connection?
I’m running an application on JBoss 7 connected to a MariaDB database hosted on a separate AWS EC2 instance (c5.9xlarge). The SQL query execution itself is extremely fast (around 57ms), but when ...
3
votes
5
answers
171
views
How to get the number of rows from multiple related tables with one query
I have four tables, one primary and three dependents, let's call them A, B, C and D.
All tables have the column ID, with ID being the primary key for A and the foreign key for B-D.
B-D also have a ...
2
votes
1
answer
70
views
How to wait for replication at mariadb transaction commit?
I have a MariaDB cluster made with Galera and my clients use MaxScale with RW router.
I'm having an issue because the application has something this sequential steps:
Start trx1
Insert new record
...
0
votes
0
answers
93
views
The Laravel project on production continues to give database connection error intermittently
The Laravel project on production continues to show the error below intermittently:
SQLSTATE[HY000] [1130] Host 'localhost' is not allowed to connect to
this MariaDB server (Connection: mysql, SQL: ...
0
votes
0
answers
50
views
Best practice for avoiding cluster lockups in Galera DDL scripts
we have a Galera (wsrep_provider_version 4.23) cluster over 3 MariaDB 11.8.3 nodes. Our application has a number of migration scripts (about 50) that run on startup, via Flyway. At some point in the ...
-4
votes
1
answer
97
views
How do I retrieve the primary key of the updated record?
I have this insert query for my MariaDB 10.6.19 database:
CREATE TABLE manufacturers (
manufacturers_id int(11) NOT NULL AUTO_INCREMENT key,
manufacturers_name varchar(32) unique NOT NULL,
...
4
votes
2
answers
672
views
MariaDB / PDO / PHP 1020 error ("Record has changed since last read in table")
How do I correctly deal with 1020 errors within a transaction in MariaDB?
I recently encounter 1020 "Record has changed since last read in table" errors on code that run without this error ...
1
vote
1
answer
78
views
SQL - Adding Union All on derived table subquery fetches all rows
Attempting to optimize a portion of a query that is joining two related tables, and getting odd results compared to other queries in the project with similar structures. Here is a very simplified ...
0
votes
0
answers
69
views
Connection InteliJ IDEA => (docker) MariaDB:11 not working - access denied
TL;DR
Host: Windows 10 + Idea, Docker Desktop. Container: mariadb:latest.
In-Docker connection (docker exec -it mariadb-container ... working).
Host connection returns:
[28000][1045] (conn=13) Access ...
1
vote
1
answer
113
views
mysql_real_query hangs in multithreaded quickfix app [closed]
We have a simple quickfix app that translates FIX messages into our own internal format and vice versa.
It consists of two threads, one of which is the FIX::Application and FIX::MessageCracker, and ...
0
votes
1
answer
61
views
Laravel: Table name is misspelled in SQL statement [duplicate]
I've already written a web application with Laravel, but I'm not nearly as experienced yet. Therefore, I need to ask for help.
Platform: Laravel 12 Starter Kit LiveWire, PHP 8.2.12
Database: mariadb
...
1
vote
0
answers
55
views
PrestaShop Docker container: ‘Access denied for user’ when connecting to MariaDB, even after volume reset on ARM Mac
I am new to Docker. I am trying to run PrestaShop 1.7.7.2 using Docker Compose on my ARM Mac. The stack includes MariaDB, PrestaShop, and phpMyAdmin. Instead when I access the localhost on the web I ...
1
vote
2
answers
162
views
Mariadb query to find a field change working backwards in a table
I am trying to write some sql code to embed in Qt to find out when it last rained.
Table
CREATE TABLE `weather_data` (
`time` bigint(20) NOT NULL,
`temp_1` float DEFAULT NULL,
`humid_1` float ...
0
votes
2
answers
178
views
How to remove duplicate values that are NOT within a range from a MariaDB table?
I have a MariaDB table like this:
CREATE TABLE metric_value (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
metric_id int(10) unsigned DEFAULT NULL,
value decimal(17,2) unsigned NOT NULL,
...
1
vote
0
answers
119
views
Configure MariaDB DSN using Add-OdbcDsn in PowerShell
I'm trying to configure a MariaDB ODBC DSN automatically in PowerShell
my code so far is this:
$DriverName = (Get-OdbcDriver -Name "MariaDB*" | Where-Object Platform -eq "64-bit")....
0
votes
1
answer
263
views
how to change collation connection and character set in simpler way
I am having a database in MariaDB with Latin1 character set and collation connection as Latin1_general_ci. Now I want to change it to utf8mb and utf8mb_general_ci. And my database is of 650GB.
So, ...
0
votes
1
answer
71
views
How to know the character set use in mysql column row event
I have written a python program to parse mysql binlog. In the Query Event, there is a Q_CHARSET_CODE which indicate what character set is used for the logged query. This indicated that the logged ...
4
votes
2
answers
166
views
Catastrophic query planning, non-use of index in MySQL 8+
I have a legacy Drupal 7 site that is used strictly internally. It's replacement is under active development, but in the meantime it is using Aurora2, MySQL 5.7 compatible and is in very expensive ...
0
votes
2
answers
160
views
MariaDB left join ignores index key - slow performance with large joined table
I have a select with a large joined table. On local, performance is fine, but on my server it takes much longer. Below are the version infos (I just upgraded to MariaDB 11.4 on the server).
If I do an ...
0
votes
2
answers
223
views
Cannot connect to mariadb database from VB.Net app with credentials that work from Python on a different system
I have a couple of databases running under mariadb on a Synology NAS, which are being updated and read without problems using the standard mariadb connector across my local network by Python scripts ...
0
votes
1
answer
346
views
Doctrine migration error: Unknown column 'ccsa.FULL_COLLATION_NAME' in 'on clause' Body:
I am learning Symfony and trying to create a simple API. I have defined two Doctrine entities, GameGenre and Game. Here are their codes:
This is my GameGenre Entity:
<?php
namespace App\Entity;
...
0
votes
1
answer
69
views
Creating procedural code for MariaDB in dbeaver
I'm trying to create a script that contains a procedure and then call that procedure. I've done this at work where we use Oracle, but no matter what I try with mariadb, I get an error. So I copied ...
0
votes
1
answer
146
views
Calling a Javascript async function with async/await when streaming JSON and parsing (Node.js)
I am trying to parse an enormous JSON stream in Javascript using Node.js, which is then stored in mariadb. As part of that, I have a table that will have a small number of rows (~50), but each row ...
0
votes
1
answer
115
views
Can't connect to MariaDB in godot
I'm trying to connect to my local database on godot, and the _connect_to_dv_srvr() function does not return any errors. But once I try to create a connection instance, it returns null!
var db_general: ...
2
votes
3
answers
126
views
join subquery return multiple rows
I have main query:
SELECT mt.media_id, mt.title,
SUM(DISTINCT sht.share) as share_count
FROM $grouped_media_table mt
LEFT JOIN $share_table sht ON sht.media_id = mt.media_id AND sht.title = mt....
1
vote
1
answer
72
views
MariaDb Use Column In primary Query in sub Query
I have a table that has store names, product codes and prices.
I need to pull the minimum price of a product and display a list of the product codes with their minimum price, where it all falls down ...
0
votes
1
answer
105
views
Best practices for caching subsets of time-series data in MariaDB? [closed]
I have a sensor_status table that logs the status of hundreds of sensors every 45 minutes
CREATE TABLE sensor_status (
status_id INT AUTO_INCREMENT PRIMARY KEY,
sensor_id INT NOT NULL,
status ...
3
votes
1
answer
109
views
How do I output the SQL code generated by boost::mysql::with_params()?
I'm using boost::mysql and boost:asio to access a MariaDB database. I'm prototyping a project/task management system. A task has a number of dates associated with it. When attempting to insert a task ...
5
votes
0
answers
208
views
MySql.EntityFrameworkCore: Unable to cast object of type 'System.DBNull' to type 'System.Int64'
I'm trying to build a minimal Api for access to a local MariaDB database and my tech is .NET 9, EF, MySql.EntityFrameworkCore, Migrations (Code First) and MariaDB (XAMPP).
When I try to update ...
3
votes
1
answer
86
views
Quering system versioned table doesn't return results
I have some system_versioned tables. After upgrading to version 11.8.2, I no longer get results when querying without explicit AS OF-syntax.
SELECT
m.*
FROM
mydb.mytable m
doesn't get any ...
0
votes
1
answer
58
views
In Mariadb and Galera cluster, will I get different value of a field in different node?
In Mariadb and Galera cluster, we have 3 nodes. I update a field from 99 to 100 through node 1. If I retrieve the same field through node 2, will I get 99 instead of 100 ?
Because the field is used ...
0
votes
1
answer
114
views
Can I create a consecutive sequence number using MariaDB and Galera Cluster?
I have 3 nodes in the galera cluster. When I get the next value from a sequence, it has gaps between the numbers. e.g. 1,4,7...
I would like to write a function to get a sequence number from a table ...
1
vote
1
answer
95
views
MariaDB returns timestamp with two hours difference
I have a MariaDB running inside a Docker container. There is a table inside a database, that has a column of type TIMESTAMP. I am connecting to the database through my TypeScript application, using ...
0
votes
1
answer
91
views
Running Django tests in parallel on MariaDB, get "No such file or directory: 'mysqldump'"
I have a Django project running locally, with its database as MariaDB 10.6 running in a Docker container. The Django tests work fine, but when I try to run them with a --parallel flag I get an error &...
0
votes
0
answers
48
views
Is Lost Update without certification failure expected in Galera Cluster?
I'm using a multi-node Galera Cluster and encountered the following two scenarios:
Case 1 — Certification Conflict (Deadlock) occurs:
Node B and Node C both start transactions.
Both try to update the ...
0
votes
1
answer
40
views
Writing complex JSON queries in MariaDB
I have a MariaDB database storing records containing JSON documents, and I need to write several queries against the contents of these documents.
Say our table is simply named table and it has two ...
0
votes
1
answer
98
views
MariaDB: docker compose will mount /var/lib/mysql but not other volumes
This is my Docker Compose for MariaDB:
mariadb:
container_name: mariadb
image: mariadb:latest
environment:
- MYSQL_DATABASE=homeassistant
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
...
0
votes
0
answers
102
views
Strawberry Perl 5.40(.2) - DBD::MariaDB issue with MariaDB 11.7
I have the latest C Connector - libmariadb.dll v 3.4.5 - getting the following error when attempting a connection using DBI - install_driver(MariaDB) failed: Can't find 'boot_DBD__MariaDB' symbol in C:...
-4
votes
2
answers
205
views
How do I get a weekly time series on Grafana? [closed]
I am using MariaDB and Grafana to keep track of weekly consumption totals, but Grafana does not recognize this date format "DATE_FORMAT(`Timestamp`, '%Y-%u') AS Week" as a time field.
The ...
-1
votes
1
answer
68
views
Mariadb time data corrupted after server crash [duplicate]
I have a problem when the server is down and when it is finished processing, the old data in the database is time-shifted.
column information: created_at - timestamp
i use Laravel 11 + mariadb, php8....
0
votes
1
answer
47
views
Many-to-many and One-to-many in Prisma
I am trying to make a database with the structure:
model Game {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
lobbyName String
authorId ...