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
18 views

Mysql grant restricted to specific hours of a day

I'd like to know if it is possible in mysql to grant select permission to user but only within specific hours of a day. I have created several views and new user and want to let them browse those ...
-1
votes
0answers
8 views

Cron copy records from one table and insert to second table

Please forgive me, but I am just starting to learn to work with the database, so your support will be very valuable to me. I've table with name: enrol Now I need run cron every month and copy table ...
0
votes
0answers
7 views

Conceptual ERD for barber

In need of help, as I am a newbie on database design. So, on the first image I attached, it was based on my design. I am a bit confused about three things is it okay for "Barber", "...
2
votes
1answer
21 views

Why do we need a Unique key when we have a Primary key?

I tried to Google this question but all I found were differences between primary and unique keys, why do we actually need a unique key when we have a primary key that can identify any single record, ...
0
votes
0answers
4 views

mysql login stopped working after /tmp filled up

I have a mysql database on an ubuntu server. When I ssh into the ubuntu server and try to login to the mysql database using the commands below, I get the error below. If I use the same command but ...
1
vote
0answers
6 views

Inndob Cluster - Automatically collect the output from mysqlsh?

Is there a way to take the output from mysqlshell and use it in a script or similar. I have set up a basic cluster for testing (3 x MySQL 8.0.27 databases, running on Debian 11). I am now trying to ...
0
votes
0answers
30 views

Mysql resetted after upgrading from 80025 to 80027

I was with 8.0.25-0ubuntu0.20.04.1 (as the log say), and I made apt update && apt upgrade (specially to fix some issue with other packages). But, when upgrading, it said "Failed to ...
0
votes
0answers
11 views

Get top users with user type by amount

i have tried to find top retailer and top distributor with below query. SELECT (SELECT SUM(amount) AS total_amount FROM transactions tm LEFT JOIN user_master um ON um.p_id = tm.user_id ...
0
votes
1answer
11 views

how to convert a string to date in MySQL 5.7

Now I have a data string like this 2002年05月11日, I want to convert this string as a unix date timestamp, what should I do to convert this time? I have tried this way: select STR_TO_DATE("...
0
votes
0answers
11 views

Is it possible to set a shortcut for MySQL CLI to "delete word through Ctrl+W"?

Current default behavior is that MySQL CLI deletes whole line. I am using Ubuntu 20.04, MySQL version 8.0
0
votes
1answer
13 views

how to update id as row number in MySQL 5.7

I have a table did not contains id, now I add the id column and want to update the id as row number, what should I do? this is my table DDL: CREATE TABLE `spark_car_brand` ( `alpha` varchar(255) ...
1
vote
1answer
33 views

Selecting gives one row, updating affects 2

When I select using WHERE clause that uses the same columns as a UNIQUE constraint "mytable_uniq_detail_date" (detail_id and date), I get a single row, but when I upsert a row data that (as ...
0
votes
1answer
28 views

Best practice for SQL table names when using sub namespaces that exceed maximum table name length

I have a MySQL database that includes many tables named according to a namespace that uses sub names and underscores (_ as in a_b_c), such as the following: life_domain_kingdom_phylum ...
0
votes
1answer
18 views

Database Design For Realty Website Review

I am designing a real estate website and wanted feedback from some professionals about the database schema that I came up with. I created a property table that would have each house. Each house can be ...
0
votes
0answers
13 views

replicate-wild-do-table causes unknown database error My-001049 for CREATE PROCEDURE on not replicated schema

OS: RHEL 7.7 Percona server 8.0.26-16 I am trying to create a simple replication topology with one master and one slave. The master has 9 schema out of which three are being replicated to the slave. ...
-1
votes
0answers
11 views

How can I set up a mysql server to perform nightly reads from Azure SQL using Active Directory?

I am setting up a mysql database as a local data warehouse. We are going to read data into it from a variety of data sources including an on-prem Azure SQL database, however at present in order (for ...
0
votes
1answer
22 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)...
-1
votes
2answers
39 views

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
46 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 ...
1
vote
1answer
15 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
2answers
23 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
42 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
13 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
25 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
22 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
22 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
7 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
10 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
27 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
25 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
1answer
42 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
20 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 --...
0
votes
2answers
40 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
40 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
36 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
18 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
31 views

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

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
42 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 ...

1
2 3 4 5
420