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

MySQL select all the ids with the same column value

Here is my table: movies_franchies: movie_id franchise_id 1 10 2 11 3 10 4 15 1 11 What i want: get all movie_id with the same franchise_id as my target movie (movie_id - 1 for example) except target ...
-1
votes
1answer
15 views

How can I mysqldump all databases except the mysql schema In Windows

I want to backup all 200+ databases on a MySQL server to all-dbs.sql. I want to exclude the mysql schema. How can I do that IN WINDOWS?
0
votes
1answer
16 views

MYSQL LOAD DATA INFILE giving ERROR 1265

I'm getting a "Error Code: 1265. Data truncated for column 'value' at row 1". At a complete loss as to the source of the error. Here is the SQL LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL ...
0
votes
1answer
8 views

How do I run a mysql script on my dev machine

I am running MySQL in a docker container on my macbook pro. I would like to restore a database using a command line. I have 3 scripts that are thousands of lines long and would like to run them from....
0
votes
1answer
15 views

Why does mysql join strategy depend on this value?

I have a simple select, involving a join: SELECT `user`.*, `group`.`alias` AS `group_alias` FROM `user` INNER JOIN `group` ON `user`.`group_id` = `group`.`id` WHERE `user`.`state` = 1 AND `group`...
0
votes
1answer
18 views

MYSQL Error 1064 on INSERT INTO with CTE

I am trying to write a stored procedure to return a calculated value from a dataset by writing the result to a table. When I run this code on MySQL 8.0.32, I get an error 1064 Syntax error on the ...
0
votes
1answer
26 views

Sudden Insertion Error to a 3 years old table with 5 million of records - Mysql error 1452 - Insert Problem

I've a table with a 5 million of records. Suddenly Database table stopped inserting a record. while record exists in parent table and record insertion is same in child table as It supposed to be. But ...
0
votes
0answers
7 views

Configuration error: Error: Could not alloc node id at 172.xx.xx.2 port 1186: Connection done from wrong host ip 172.xx.x.4

Im running in datanode 2 ndb_restorebut it get me error. [root@a5aabaf20dc3 /]# ndb_restore --ndb-connectstring=172.xx.xx.2:1186 \ > --nodeid=2 --backupid=1 \ > ...
-1
votes
0answers
8 views

how to import aws s3 data dump to mysql

I have a aws s3 database dump and I need to import it into mysql on my local machine. can some one help me with this. thank you.
0
votes
0answers
10 views

Percona MySQL Server: Unrecognized network connections

I recently setup a basic two-node master/slave replication database using Percona's MySQL Server version 8.0.25-15, and during testing I ran pt-summary and noticed an IP I don't recognize in the "...
1
vote
2answers
49 views

Avoid Deadlock on concurrent insert

I am trying to avoid a future problem. Table has 2 fields: id -> bigint Primary key hash -> varchar(65) unique key there will be concurrent inserts into the table for hash. I need the last ...
-1
votes
1answer
10 views

Error log "[Warning] InnoDB: innodb_open_files=10 is exceeded (10) files stay open)"

I just created a new Digital Ocean VPS, and when looking at my log file it gives me this warning. I'm running a wordpress site. Any ideas what this is? Do I need to increase this, and by how much?
0
votes
3answers
28 views

MySQL query performance on single table

I've got a slow query (about 6-10 minutes) that I've been trying to speed up and I'd really appreciate any pointers. I've followed various guides to creating indexes based on cardinality of columns ...
0
votes
0answers
14 views

IDE/Plugin for inline editing MySQL data records like a regular file in its own tab

I'm using Code OSS v1.58.0. One of my projects stores HTML content in a database. I'm looking for a tool or a plugin for Code OSS that can open data records like a file. As it were an equivalent to ...
0
votes
0answers
9 views

How to select records Composite Primary key and Foreign key reference (many to many relationship)

I am tyring to learn composite Primary Key and Foregin Key. Wherein I am trying to have many to many mappings. Have three tables here. CREATE TABLE authors( authorID INT PRIMARY KEY , firstName ...
-3
votes
0answers
17 views

How to combine results of multiple rows from a single column having same foreign key into a single array row

Table 1 ID | Artid | Title | Subtitle 1 | 1 | test1 | XYZ 2 | 2 | test2 | ABC Table 2 ID | Artid | Value 1 | 1 | ABC 2 | 1 | QWR 3 | 1 | HJK 4 | 2 | OPL 5 | 2 ...
0
votes
1answer
20 views

Key column 'BranchNo' doesn't exist

CREATE TABLE Staff (staffNo varchar(10) PRIMARY KEY, FName nvarchar(20), LName nvarchar(20), position varchar(15), ...
1
vote
0answers
12 views

MySQL is not showing the history queries after the ETL is complete

I am using docker container for MySQL and Spark. Both containers are on AWS Ec2 instance. Pyspark ETL connects to MySQL with JDBC and start extracting the data. When the ETL is running i can see the ...
1
vote
1answer
20 views

MySQL UNIQUE KEY based on referenced table column

Say I have the following tables representing a three-level constrained relation: CREATE TABLE `books` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, PRIMARY KEY (`...
2
votes
2answers
40 views

mysqldump all database including user/password and grants

I am running 10.5.12-MariaDB and trying to take full backup of all databases including user accounts/ passwords and Grants but somehow i am not able to take backup of grants so am i missing something. ...
1
vote
1answer
22 views

set a lower privilege permission on a specific database when a GRANT ALL exists on a pattern matching this database on MySQL

I have a user which has access (GRANT ALL) to a set of databases matching a wildcard pattern, now I would like to remove one specific database matching this wildcard from it's access. mysql> select ...
1
vote
1answer
34 views

Group by latest date with conditions

I need your help! Let's say I have this table: Instance Date MetricID Value Marc 09/14/21 1 5 Marc 09/14/21 2 2 Marc 09/14/21 3 1 John 09/14/21 1 10 John 09/14/21 2 1 John 09/14/21 3 1 Marc 09/...
1
vote
1answer
21 views

MySQL query show something like 0x8081 instead of special characters

When i run SELECT CHAR(128,129,130,131,132,133,134,135,136,137); I got 0x80818283848586878889 istead of Çüéâäàåçêë. Does anybody know why?, I'm using charset utf8mb4. When I run show variables like '%...
0
votes
1answer
22 views

MySQL memory usage overflow cause VM to reboot

I have 5 mysql servers in master-master group replication setup. (MySQL version 8.0.26) 2 nodes are having 1vCore and 2GB RAM and 20GB HDD configurations, and rest 3 nodes are having about 32GB RAM ...
0
votes
0answers
14 views

Intermittent SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'server.here' (110)

I'm suddenly having intermittent 2003 connection errors and I can't find anything that has changed that can explain it. These servers have been running smoothly for years and suddenly two days ago ...
0
votes
1answer
17 views

Amazon RDS index creation on large table over 300 M records

I need to create a new index on large table in RDS MySQL. This index is needed to reduce the scan time on this table. Below is the configuration: Table size: 400 GB Records: 400 Million column - ...
1
vote
0answers
33 views

Turning Mysql values row into columns by form_id and entry_id

I would like to understand how I can turn these rows into columns in MySql This is how the DB is saved: id form_id entry_id meta_value 1 7 18 Name 2 7 18 Date 3 7 18 Phone 4 7 18 Email 5 7 18 ...
-1
votes
2answers
26 views

What is the proper way to handle multithreading insert

I'm a newbie on Database and for now I need to work with MySQL to build a web server. In a word, I have a web framework, developed with Python. It will read/write data from/into MySQL. For now I don't ...
1
vote
1answer
18 views

Does AWS Aurora include support for the MySQL Plugin API?

Amazon Aurora is marketed as a "MySQL and PostgreSQL-compatible relational database built for the cloud". Does AWS Aurora include support for the MySQL Plugin API?
0
votes
2answers
65 views

Without using 'INTERSECT' , How to retrieve only the rows that exist in both tables?

I am a beginner reading the book Sams Teach Yourself SQL in 10 Minutes (Fifth Edition) to learn SQL. Here is an expmple SQL query from the book from Chapter 14 - Combining Queries. My question ...
0
votes
1answer
22 views

Identify what is shutting down MySQL Server

It has been few weeks that MySQL shuts downs "by himself", and I'm not able to identify why. Maybe one of you could help me. Here is the error logs. They're always the same. MySQL seem to be ...
0
votes
0answers
17 views

RDB data combination table modeling

There's data and if I combine it, I need to get the corresponding result. If I choose A and I got B, If I choose B, I should also get A. I want to save both data and combinations in DB, but it's hard ...
1
vote
1answer
27 views

need help with joining the 2 tables on closest date

I am a newbie in SQL and need help with the joining of these 2 tables on the closest date. Thanks in Advance! Table A billing_start_date id status 2020-07-27 100 active 2018-12-27 101 inactive ...
0
votes
0answers
7 views

how to sync one table of AWS RDS to another RDS

I have requirement like need to synchronize one table of data (contain user list) in AWS RDS instance to another RDS Instance. only particular user's table need to synchronize. ex: RDS-1 have schema ...
1
vote
3answers
28 views

Getting fatal error 1236 from master when reading data from binary log in mariadb master master replication

I am facing the situation similar to this Error 1236 - "Could not find first log file name in binary log index file" I have tried all the answers but I am still not able to get rid of this ...
6
votes
1answer
228 views

How do you tune innodb_read_io_threads?

The default value of innodb_read_io_threads and innodb_write_io_threads is 4. How do you check if your server load needs a higher number of threads? As I regularly check show engine innodb status \G, ...
0
votes
1answer
18 views

Mysql - Set timeout for Alter table & Update scripts

On MySQL 5.7. I would like to prevent all alter table scripts \ update scripts that are taking longer than 10 minutes to run. Is it possible? I've tried to set MAX_EXECUTION_TIME and it does work but ...
0
votes
0answers
51 views

MariaDB: No database selected error on some query [migrated]

I have a php code that rise a query against a MariaDB (using MariaDB 10.5.11 on debian 11) table; I use php-mysql prepared queries for this task as reported in the code below: if($this->dbcon->...
-1
votes
0answers
15 views

¿Cómo hacer una consulta que usando latitud y longitud GPS y notificar si esta fuera del sector? [closed]

Estoy trabajando en un proyecto que consiste en enviar un mensaje de alerta si un ganado sale de un sector establecido, para esto cree 4 tablas llamadas de la siguiente forma: Bovino, Lote, ...
0
votes
0answers
10 views

Mysql error slave does not connect to master db

I'm setting up a replica, made every configuration as I should. but when I run show slave status;, I get the result below +----------------------+----------------+----------------+-------------+-------...
0
votes
1answer
44 views

SELECTing n rows for each GROUP with WHERE condition

I SELECT n rows for each ArticleID from TagMap table SELECT a.ArticleID,a.TagID FROM TagMap a LEFT JOIN TagMap b ON a.ArticleID = b.ArticleID AND a.TagID < b.TagID GROUP BY a.ArticleID,a.TagID ...
1
vote
1answer
17 views

mysql - import only data from full dump?

I have a full dump from database A. I want to import only the data of this dump into database B. Database B's structure is the same as database A only it misses some tables. How can I do this? The ...
0
votes
1answer
13 views

MySQL 8 install doesn't include mysql.exe (Windows)

I've installed MySQL 8.0 using mysql-installer-community-8.0.26.0.msi. Mainly these options: But there's no binaries for connecting (mysql.exe) or dumping (mysqldump.exe): What else do I need to ...
0
votes
1answer
18 views

mariaDB with a 3 node galera cluster is eating more and more RAM

I am running mariaDB 10.3.29 in a 3 node Galera Cluster on 3 VMs with 14G RAM each. Despite configuring to best knowledge, it continues to eat more and more RAM and after around 3 months the machines ...
0
votes
1answer
34 views

How to speed up queries for 2m Datasets in PHP & Mysql

We have a SaaS Application site, where we would have over 2M records in a table. Server version: 8.0.19 - MySQL Community Server - GPL Protocol version: 10 Even with the indexes these queries are ...
-2
votes
2answers
17 views

Create Table in MySQL with Exactly One not NULL value in a combination of columns

I have 3 tables namely: 1. department_heads DepartmentID StaffID 2. sub_department_heads SubDepartmentID StaffID 3. branch_managers BranchID StaffID Now what I want is not have staff being a ...
0
votes
2answers
58 views

CASE WHEN with Multiple conditions [closed]

I am trying to create new column using following conditions in MySQL Workbench. I followed this example Nested case statements vs multiple criteria case statements and i am able to get all the results ...
1
vote
0answers
30 views

Mysql 5.6 tmpdir change deletes some users

We have a Percona-mysql 5.6 setup with one master and one replica. After trying to do a big ALTER TABLE on it, it failed because the tmpdir was inside of the memory and therefore wasn't big enough. ...
-2
votes
0answers
10 views

MySQL Group Replication Query

In case of MySQL Group Replication how will the application connects to DB? For 3 node group replication, do we need to configure all the 3 DB nodes hostnames in the connection sting to connect to DB? ...
0
votes
0answers
27 views

MariaDB lost database MYSQL after 1-2 days

I have a big problem and i tried to fix this since weeks. After 1-2 days i lost the database "mysql" in MariaDB (Server version: 10.5.12-MariaDB MariaDB package) running on OpenSuSe Leap 15....

1
2 3 4 5
413