Questions tagged [mysql]

All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Mysql 5.6 Memory usage keeps increasing till it is killed by OOM killer

we have a production mysql 5.6.46, which is under heavy load (2000 Queries per second). The memory allocation to Mysql keeps on increasing over a period of time (sometimes in 1 day, sometime in 1 week)...
0
votes
0answers
1 view

Mysql Server high CPU load and high memory usage

Greeting everyone, I have a Cpanel VPS server with below details : 8Core CPU | 32GB RAM | 450GB SSDNVME Cpanel V100.0.5 on CentOS v7.9.2009 Mysql V8.0 Litespeed server Web Host Professional (2-Worker) ...
0
votes
1answer
7 views

mysql --login-path connecting to the wrong database

I have a strange problem with mysql and the --login-path option. I have configurated multiple users and databases, some local and some remote using mysql_config_editor. But since I had my last ...
0
votes
2answers
40 views

Best practice for a database used by multiple versions of an application

I'm working on a new product which will run on-premise at our customers. The configuration and usage of this application will be stored in a database. One of the requirements is that a newer version ...
0
votes
1answer
11 views

MariaDB/MySQL backup replication

I have currently two DB instanced with two-way replication. Each replicates other database. So both are master and slave. So every change in any of these databases is automatically replicated to the ...
0
votes
1answer
5 views

Using nested json_arrayagg with two table which have many to many relationship

Consider following two tables in mysql database role(role_id); task(task_id); and a pivot table role(role_id,task_id) I can extract a single role in JSON format using the following query select ...
-3
votes
0answers
40 views

LIGHTEST weight relational database for node [closed]

I know that SQLite is lightweight but I wonder how much of the ram it takes up. I am trying to set up a personal POC in a aws micro (.5GB ram) and I am trying to max the efficiency at the knitty ...
0
votes
0answers
7 views

MariaDB Galera cluster filling disk with gcache.page files

I am running 3 node Galera cluster MariaDB-server-10.3.13-1.el7.centos.x86_64 on CentOS7 and its been 2 years no issue but suddenly recently without any change on node-2/3 disk started filling up and ...
0
votes
0answers
9 views

How to start Mysql group replication member resync

I have three members in group replication. Two is online but third has error and not joined to group. I have tried to drop and import new database but member still has error state. How to force member ...
0
votes
0answers
11 views

ERROR 1682 (HY000): Native table 'performance_schema'.'global_variables' has the wrong structure

I’m getting stuck into a strange problem. When I check for global_variable -it says my performance schema has wrong structure: mysql> SHOW GLOBAL VARIABLES WHERE Variable_name = 'gtid_mode'; ...
1
vote
1answer
22 views

Effectively implementing associated values in a MySQL database

I'm a Swift iOS developer, and whenever I come across a data modeling problem where there is a property of an object that can have one of two different values, its type is usually going to be an ...
0
votes
1answer
25 views

How to check if update query was executed or not in MySQL?

I have an update query in MySQL and I want to return true or false based on whether my update query was executed or not. Is there any way we can find whether the update query is executed? UPDATE table ...
0
votes
2answers
20 views

MySql NDB cluster large transaction

I know that with NDB you can not do large transactions, if you do data nodes can restart into read-only mode and corrupt table. I need to copy records into a new table but the thing is this table ...
0
votes
1answer
21 views

mysql query with date hours and interval

I have EXPIRATION column in mysql table which contains date in following format 2022-02-15 08:00:00 I am trying to query username whose expiry is on 2022-02-17 08:00:00 using below query SELECT ...
0
votes
0answers
6 views

How to output error for Mysql Group Replication member state

I have error on one of tree sql gr servers SELECT CHANNEL_NAME, MEMBER_STATE, MEMBER_VERSIO, MEMBER_ID FROM performance_schema.replication_group_members; +---------------------------+-----------+-----...
0
votes
0answers
12 views

Databases not showing/disappeared on mysql. Restore from bin logs

What happened I was working on my very first Laravel project and had a problem migrating (local server) it gave the error SQLSTATE[HY000]: General error: 1030 Got error 168 After some googling I ...
-4
votes
0answers
9 views

mysqli::query(): (21000/1242): Subquery returns more than 1 row [closed]

MODEL public function LaporanQuery($dari, $sampai, $pertashop){ return $this->db->query("SELECT DATE_FORMAT(tbl_laporan1.tanggal,'%d/%m/%Y') AS tanggal, id_pertashop, ...
-1
votes
2answers
23 views

How to increase mariabd disk space

I am getting this error and yes i tried to edit my.ini file its empty the hosting panel is cyberpanel and I cant edit it even with "VIM" and I am facing this error (/tmp/#sql-temptable-33e-...
0
votes
0answers
15 views

Why JSON indexing take less storage than multiple columns in MySQL 8?

I am doing a quick performance comparison for 10 000 rows on MySQL 8.0.27 between a table multiple_cols with 2 columns num INT and str CHAR(200) having each an index, a table json_indexing with 1 ...
-2
votes
1answer
23 views

SQL Subquery not working in Redshift

I'm trying to calculate report for ratio per week. Ratio = Sales_Dollars/Inventory_Dollars Sales_dollars per week and Inventory_dollars per week are calculated separately in 2 different queries (A, B) ...
-1
votes
0answers
31 views
+50

How to design a complex multi approval expense db schema in MySQL

I'm very beginner in database design and had the following problem to solve. DB schema design for an expense approval system with these cases approval system, every company has 1 or many teams where ...
1
vote
1answer
36 views

Stored procedure on OVHCloud MySQL server fails with Unknown column '' in 'field list'

I'm using the jaro winkler stored procedure here: https://gist.github.com/TheHiddenHaku/7229861. This runs fine on my local MySQL server (version 8.0.19) but when trying to use the same function on ...
-4
votes
0answers
25 views

Stock quantity Trigger in MySql [closed]

I want a simple pl/sql code that works on phpmyadmin to do the following. I have two tables, the first is called products and the second is called order. The two tables have a column with the name of ...
0
votes
1answer
24 views

Mariadb replication - Ignore users changes

I posted this question on ServerFault but was told to ask it here. I need to set up multi-source replication (3 masters and 1 slave). I'd like to avoid replicating users' changes on the slave because ...
0
votes
1answer
18 views

How to backup from MySQL Ubuntu to Synology NAS MariaDB

I am facing difficulties when setting up MariaDB on Synology NAS as slave to replicate my server on Ubuntu. But there are missing commands and files (my.cnf) in the installation. Need help on any ...
0
votes
0answers
14 views

Which option should I use to avoid error #2006 on MySQL (Docker Compose)

I am getting error #2006 - MySQL server has gone away while trying to restore a 11.9 mb database using PhpMyAdmin. It worked with a 4.70 mb database, but not with this one I thought that if I put --...
-1
votes
1answer
19 views

replication and sharding [closed]

Which of the following statement(s) is/are correct regarding Replication and Sharding? Select one or more: a. Master-slave replication reduces the chance of read-write conflicts. b. Master-slave ...
0
votes
2answers
38 views

Error when migrate mysql 8 to Sql Server 2019

I have e error while migrate a database Mysql 8.0 to SqlServer 2019 with Sql Server Migration Assistant to Mysql. The message: ExecuteReader requires an open and available Connection. The connection's ...
-1
votes
0answers
6 views

MySQL, able to connect from a Windows server using HeidiSQL but unable to connect in linux host using cmd

I am connecting to a MySql server which is placed on a Linux Server, from a Windows machine using HeidiSQL and an ODBC driver. When i use the same credentials (mysql -u bi_user -h dbn-02 -p) to ...
0
votes
1answer
35 views

Unknown column in field list MariaDB

I am using PHPMyAdmin and MariaDB and get this weird error as mentioned in the title. CALL log_total_outstanding(@message); MySQL said: Documentation #1054 - Unknown column 'time' in 'field list' I ...
1
vote
1answer
35 views

How to set up MySQL remote hosts IP address for users with dynamic IP's

Background I need remote access from my Delphi PC application to a MySQL database hosted on a shared server at my ISP. This DB is not associated with any web site. All there is on my ISP account is ...
0
votes
1answer
15 views

Negative values on unsigned int with union all

When I do union all on queries with unsigned int fields, it returns negative results. Can someone explain this behavior to me ? How can I have real ids in "ticketIn" ? Schema (MySQL v5.7) ...
0
votes
1answer
29 views

What could be the better Database to make a book reader one or more books?

I am thinking about a personal book reading mobile app project. I have a total of 13 different books. Each book has 10 chapters and each chapter has its own content. It should have the feature of ...
0
votes
1answer
41 views

Strong vs weak entity types on SQL

I have a 3NF normalized database design and was trying to understand the concept of strong vs weak entity types and my understanding is weak entity types are tables that don't have a primary key. ...
0
votes
1answer
27 views

What is good approach in storing price changes of a product / currency?

I am building a system where users can own a currency pretty much like crypto. The idea is that the value of that currency changes every 24 hours based on certain factors. Here's an example. There's a ...
0
votes
0answers
21 views

mysql 8.0.26 - stored procedure name length issue (25 Chars) only

I have found a very odd issue with mysql 8.0.26. If I try to either create a procedure via the command line interface (mysql shell) or via a sql script, if the stored procedure name is 25 characters ...
0
votes
0answers
9 views

The doubt about the abbreviated terms appeared during the mysqlbackup

How to "decode" the corresponding abbreviated terms(including its different digital-level) appeared during the mysqlbackup stdout: 180627 11:15:47 ALW1 INFO: A thread created with Id '...
0
votes
2answers
30 views

How to optimize a big table for backup

I have a table that is not too much big but still, it takes 30GB of storage. When I try to make a backup with mysqldump it takes a lot of time and resources and I want to optimize it but I don't know ...
1
vote
2answers
36 views

Conditional rounding failling

In MySQL, I'm attempting the something like the following query but not getting the desired results: SELECT ROUND(t.price / t.qty, IF(qty > 1, 4, 2)) AS unit_cost FROM ( SELECT 0.10 AS price, 1 ...
1
vote
1answer
22 views

Why store /var/lib/mysql when you can just create SQL dumps for backup purposes?

Tools like mariabackup offer the possibility to create full and incremental file system backups of /var/lib/mysql but I don't quite understand what additional safety layer this would give me if I ...
0
votes
1answer
20 views

Creating a parent table from child relationships

I have a child relationship table as CREATE TABLE ItemRelationships ( Item1 int(11) unsigned NOT NULL, Item2 int(11) unsigned NOT NULL, INDEX(Item2), FOREIGN KEY(Item1) REFERENCES Items(ItemID) ON ...
0
votes
0answers
23 views

InnoDB - Fulltext (match against) extremely slow, wrong indexes?

I've recently migrated my myisam-tables to InnoDB and some things are a bit weird for me. For starters, the indexes looks a bit different (and maybe is the reason why the new InnoDB-implementation is ...
0
votes
0answers
24 views

python MySQLConnectionPool causes Aborted connection error in mysql?

I use simple mysql pool of 10 connections, but it looks connections are never closed that is causing Aborted connection errors in mysql. How MySQLConnectionPool actually works and it is expected that ...
0
votes
2answers
27 views

Why is field in JOIN query null?

I have three tables in a MySQL (Percona) server: What I'm trying to do is find the top albums whose photos have won the most battles. For each album, I want to display a thumbnail of its featured ...
0
votes
0answers
35 views

Can't update table in stored function/trigger because it is already used by statement which invoked this stored function/trigger

I have a problem, before I add operators at procedure, program is ok but now have messages like that, here is the trigger and procedure DELIMITER $$ CREATE PROCEDURE insertTransaksi(insertNama VARCHAR(...
0
votes
1answer
16 views

Possible to GROUP BY across different columns in mariadb/mysql

I have a table full of events similar to this: `date` | start_time | end_time | length -------------------------------------------- 2022-01-10 | 07:00:00 | 16:00:00 | 9 2022-01-11 | 07:00:...
-2
votes
2answers
41 views

1 table or multiple tables?

I am building a web application (php/mysql). There will potentially be many users (managers). There is a table (let's call it "gurus") into which a manager/user will enter lists of gurus. ...
1
vote
2answers
23 views

In MySQL, is neccesary or recommended a LOCK TABLE before a REPAIR TABLE

I need to know if is neccesary or recommended to try a LOCK TABLE before a REPAIR TABLE, because sometimes we need to make REPAIR of tables when users are working on the application. As I have tested, ...
0
votes
0answers
8 views

How to start a replica from a gtid postion two days before

I am using Blackhole tables in slave in gtid replication. There are few binary logs of slave. I want to reread old data of master binary logs from a specific gtid. I cannot execute RESET MASTER due to ...
2
votes
2answers
261 views

Why does a MySQL 'where' clause with Index make a SUM query slower?

I have a table with 5 million records. Table columns are id, customer_id, status, and amount. When I run a query without Index(status), SELECT SUM(amount) FROM `game_results` WHERE `status` = 1 the ...

1
2 3 4 5
420