Questions tagged [mariadb]
MariaDB is an open source database server that offers drop-in replacement functionality for MySQL.
0
votes
0answers
18 views
MariaDB command line stops being responsive after some time
I'm running MariaDB's (version: Ver 15.1 Distrib 10.3.12-MariaDB) mysql command to interact with the database. I'm using that multiple times a day, so I just leave window running that console open and ...
-1
votes
1answer
12 views
Python Database connection for mariadb using sqlalchemy
I am new to python. I am trying to make a database connection using python to mariadb database which is hosted on my local network. I am using sqlalchmemy to make a connection.
But facing some errors
...
0
votes
3answers
29 views
display date range with no table
is it possible to display date range in mysql withouth table?
I have this code but it lack.
SET @startDate = '2018-10-01';
SET @endDate = '2019-02-21';
select @startDate + INTERVAL seq.seq DAY AS ...
0
votes
0answers
7 views
Mariadb recursive procedure in a json
This time I come with a recursive related question:
I'm trying to transform
this json:
["buyer_name", ["first_name", "aaa", "second_name", "bbb"]]
into this php serialized array:
s:10:"buyer_name"...
3
votes
0answers
50 views
How to access a function in a function with `this`
My question is similar to this.
However, mine runs in Node.js and it seems like a bit more complicated.
The server side wasn't built by me, but someone else that I can't contact. And he wrote code ...
1
vote
1answer
24 views
How to force Hibernate use AND in update query?
I am trying to update a raw by composite primary key by using hibernate.
Hibernate uses the next style for such updates:
update mytable set mycolumn=321 where (left_pk, right_pk) = (123, 456);
Is ...
0
votes
0answers
9 views
How to select from mysql using json array from another table
I need to select all items from table1 table from table2.properties field which is JSON data.
Example data:
Table1:
--------
id
--------
1
2
3
--------
Table2:
-----------------------------------...
0
votes
1answer
15 views
User variable not updating in subquery
I am using a RECURSIVE statement on MariaDB, to get a product category path when I know the product category unique ID, from a self-referencing category table.
This works:
WITH RECURSIVE categories ...
0
votes
0answers
30 views
Integrate database on NodeJs Express locally like sqlite
How could I integrate database on NodeJs Express locally in any host like sqlite does?
I'm trying to deploy a web app on openode.io (but I will have the same problem in another hosts like heroku, ...
2
votes
2answers
20 views
MySQL FullText in Boolean mode: searching keywords that contain '+' as part of the string
I have looked at dozen 'similar' questions, without luck. I understand that + attached to a keyword in FULLTEXT in BOOLEAN mode has a special meaning,
however, what if our keyword(s) actually contain +...
0
votes
0answers
11 views
Not all character sets and collation sets change to utf8mb4(.unicde.ci)
I am trying to set character sets to utf8mb4 and collation sets to utf8mb4_unicode_ci. I try this:
Add to /etc/my.cnf:
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = ...
1
vote
0answers
20 views
Different numbers of rows when importing csv
I ran into a problem that I didn't understand. I have a .csv file that is about 10 GB in size. I'm transferring it into the database. When I use only the innodb engine, 1.863.941 lines are added. But ...
0
votes
0answers
13 views
MariaDB GeomFromText() returns NULL despite (presumably) correct Geometry
I am trying to import polygons from CSV to a MariaDB table. The CSV rows look like this:
Aa bb, 'POLYGON((406.02 717.37,405.49 717.13,404.52 716.70,405.59 714.44,406.58 715.09,407.61 715.71,407.58 ...
0
votes
0answers
11 views
Liquibase script falis when dropping Foreign Key
I want to drop foreign key from the table, but I dont know it's name.
When I run liqibase update script:
120158 [ERROR] Reason: liquibase.exception.DatabaseException: (conn=9) You have an error ...
-2
votes
0answers
11 views
what is passwordCharacterEncoding and how do you check the currernt charset? [on hold]
What does current charset mean here and how do you that option?
enter image description here
-1
votes
1answer
14 views
Python Maria DB Syntax error query parameters
I'm trying this query:
sql = """UPDATE comandi SET value = %s, DATA_RICHIESTA = %s, WHERE IOA = %s AND DATA_ESECUZIONE = %s"""
params = (result[0]['comando_apertura'], command['value'], scadenza_date....
0
votes
2answers
43 views
MariaDb SQL Injection
I am trying to exploit (legally) a MariaDb database with an SQLi vulnerability.
I have identified the vulnerability here...
/?o=1&page=app
The o=* is vulnerable and produces the following error....
0
votes
0answers
24 views
Spark DataFrameWriter uses TIMESTAMP instead of DATETIME
I am migrating my database from SQL Server to MariaDB, but I'm running into trouble with MariaDB's TIMESTAMP range limit.
I have a PySpark project that populates the database, creating tables using ...
0
votes
0answers
12 views
MariaDB (ver.10.x.x) InnoDB locking? When concurrency occur [duplicate]
I'm a developer with MariaDB using InnoDB
I have a question about InnoDB.
Here test table
column-> test_idx | test_num
value -> 1001 | 0
For example, when 50 clients have below query ...
0
votes
0answers
28 views
Mariadb configurations for optimal performance
We have a table in mariadb with large number of row like 3 million. This table is been indexed . We have job which inserts 3 million records to this table. Query on this table takes more than a minute....
-1
votes
1answer
25 views
I can't insert data into database mariadb and don't have error message
i'm trying to insert data into my database mariadb the code is the following:
<?php
require 'conexion.php';
$name = $_POST['name'];
$apellidos = $_POST['apellido'];
$email = $_POST['...
0
votes
1answer
12 views
MariaDB LOAD DATA INFILE for null DATE field
I'm trying to load a tsv file into a mariadb table. One of the fields is a DATE that's nullable.
From what I gather, load data infile uses "\N" to identify null content but in this case it's a no go:
...
0
votes
0answers
13 views
Missing MariaDB Driver Play Framework
I'm trying to get my database going in Play Framework simply following their examples.
This has proven to be uneventful as I'm stuck on this error:
It looks like the MariaDB driver simply isn't ...
0
votes
0answers
12 views
Phpmyadmin mysql query with rollup
I am having this problem for a while now. When I run following query in Phpmyadmin "SQL" window:
select ifnull(e.week,'Average Score') AS 'Week of', ifnull(e.team,'All Teams')
AS team, e.sort AS ...
0
votes
0answers
8 views
Json_valid function as a constraint in mariadb
There are different ways to create constraint in mariadb. We can either create them when creating the tables or after that. For example, the json_valid function could be defined in 3 different ways:
...
1
vote
3answers
33 views
How to select the latest records for distinct column values?
In my database I have profile ids with statuses which also have a timestamp. I want to have the latest status for each profile using a query. How can I do this the easiest way?
So f.e. for:
Id ...
0
votes
2answers
28 views
LIMIT doesn't work in MariaDB - Tried a lot of things
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "igscript";
$con = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
$query = "SELECT * FROM lastsearches";
$result = mysqli_query($...
0
votes
1answer
26 views
MySQL unexpected scope issue when referencing columns
Building on a prior question, here (stackoverflow): How to efficiently pre-filter rows in conjunction with a join?
The more versatile solution to that problem was provided by Nick, as shown below.
...
0
votes
1answer
28 views
How can I speed up queries with `GROUP BY` in them?
Details:
MariaDB: Server version: 10.2.10-MariaDB MariaDB Server
The DB table, trans_tbl is using Aria DB engine
Table is somewhat large: 126,006,123 rows
Server is not at all large: AWS t3 micro w/...
0
votes
3answers
28 views
Multiple table left join
I'm trying to figure out a SQL query to pull data from multiple tables at once. Ive got a table with a list of companies. I have two other tables containing communications from each company. Currently,...
0
votes
1answer
24 views
Control the name for a constraint in django
I have the problem that I need to replace a FOREIGN KEY constraint, generated by django, by a ON DELETE CASCADE constraint. What I want to do is to extend the django generated migration to implement ...
0
votes
1answer
14 views
How to limit MySQL general_log file size?
I need to save general_log into a file and to avoid the file is too large.
MariaDB 10.3
#This is the settings I write in the my.cnf.
[mysqld]
general_log_file = /var/log/mysql/mysql.log
general_log =...
0
votes
0answers
26 views
MySQL FIND_IN_SET function with special character not working
I have a stored procedure:
CREATE PROCEDURE MyDB.`tag_quicktrend`(
IN taglist TEXT
)
BEGIN
SELECT *
FROM taginfo
WHERE FIND_IN_SET(tagname,taglist);
END;
When I call SP:
call ...
0
votes
3answers
34 views
MySQL server version 10.3.9-MariaDB can not query text has single quote
I have a MySQL database that has a filed TagName with value ~!@#$%^&*()_+|}{":?><./';[]\=-`
I try the query select TagName from taginfo where TagName like '%@#$%';
It show data with tagname ...
0
votes
2answers
30 views
DROP CONSTRAINT is not able to find constraint
I try to drop a constraint:
USE `mydb`;
BEGIN;
ALTER TABLE `mydb` DROP CONSTRAINT `myconstraint`;
COMMIT;
And it replies with:
ERROR 1091 (42000) at line 6: Can't DROP CONSTRAINT `myconstraint`; ...
0
votes
0answers
20 views
connection to localhost works but not ip
If I connect to the database using 'localhost' as hostname, It works
$flag = [
'database_host' => 'localhost',
'database_port' => '',
'database_name' => 'dbdemo',
'database_user' => '...
0
votes
1answer
23 views
Django does not honor ON DELETE CASCADE
This is my model:
class Subscriber(models.Model):
...
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE, null=True)
...
This is the generated SQL, according to sqlmigrate (and ...
1
vote
1answer
52 views
PDO prepared statement seems to ignore HAVING clause
I've included a DB-fiddle, and you can adjust the input parameter accordingly. This returns how I would expect it to, and differs from the resutls I am seeing in PDO.
I have the following minified ...
-1
votes
0answers
34 views
Mysql load high cpu [on hold]
I am having problems with mysql mariadb
When there are about 300 hits in a moment
MySQL load up to 200% CPU makes average load ~ 45-50%. Make the website paralyzed
I have tried mysqltuner but haven't ...
1
vote
0answers
49 views
MariaDB: Shutdown right after start
So when i try to start mariadb this happens:
Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
systemctl status ...
0
votes
0answers
27 views
How to separate data into two columns from joined tables mysql
I have this log view, it displays everything.. I'm a bit confused (Noob on this) on how to separate data into two columns.
I saw this topic how to separate one column data into two columns I tried it ...
0
votes
2answers
22 views
MariaDB select only results greater than
I have a query that looks like the following:
select uid,leadcount,salescount,leadcount/salescount as diff from
(
SELECT x.uid, COUNT(*) leadcount, COUNT(DISTINCT x.fid)
FROM total_leads AS x
WHERE ...
0
votes
0answers
10 views
MariaDB, problem with [SELECT MAX(campo) +1 FROM…] and many users consulting
I have the following problem in MariaDB.
From 2 different parts they make a query to generate a correlative for a document.
SELECT MAX(campo) +1 as nuevo FROM TABLA WHERE ....;
and then insert the ...
-1
votes
1answer
42 views
is it possible to use case statement + round() in database
i have table called 'test' and want to calculate based on different codes, most of them should be saved in 5 decimals except certain code, like containing jpy in 3 decimals, and xua in 2 decimals
...
0
votes
0answers
43 views
Why are my databases deleting automatically?
I made a database with MariaDB a few days back called fivem. It deleted itself the next day I checked it. Now its just happened again like a day later. I don't understand. Its not the user privileges ...
0
votes
1answer
30 views
django rest framework + mariaDB: custom JSONField
Django: v2.1.5
DRF: v3.9.1
mariaDB: v10.3
Hi, I am a DRF newbie and I have been struggling with json field.
DRF does not support official json field type working with mariaDB and even though there ...
0
votes
1answer
28 views
Wildfly-Thorntail failing to connect to MariaDB
I need to upgrade my Wildfly-Thorntail from 2.2 to 2.3 to resolve a compatibility issue with Maven 3.6. Under Maven 3.5 with 2.2, the project builds and runs perfectly, but under 3.6 it complains with ...
1
vote
1answer
32 views
How to specify two value as DEFAULT on a column by shuffling between two values on any insertion
I have a table called user_profile with these three columns. What i am trying to do is when i don't specify any value for cover_pic column then it must insert the default random value from the given ...
0
votes
0answers
11 views
InMemory Mariadb(mariaDB4j): Address already in use: connect Exception
I am using mariaDB4j with springboot app in junit test. After few queries I am getting "Address already in use: connect Exception". Any pointers to resolve this issue would help a lot. Thanks much
...
0
votes
0answers
42 views
How can I set a type for @Lob?
I'm using @Lob annotation of Hibernate. I have to use LongBLob type, but I can't set the type to @Lob.
@Lob()
private byte[] detail;