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

Mysql, Getting all rows in which field ends in a specific character, and another field exists that is the same but doesn't end in that character

I need to get all rows which end in a specific character, P for example, but in which a similar key sans the P exists. I have no idea how to approach this one in MySQL. This is very small example, my ...
0
votes
0answers
6 views

How to export import content from inside a table using mysql commands

I'm transferring a WordPress site to a new server, but I'm trying to do the process as clean as possible. However, since I have to transfer a lot of posts to the new database, and the export feature ...
0
votes
0answers
13 views

Cannot get rid of creation of mysql.log

I have these settings in my.cnf: [mysqld] ... disable_log_bin general-log = false general_log_file = /var/log/mysql/mysqld.general.log long_query_time = 1 slow_query_log = false ...
0
votes
1answer
14 views

Using an IF statement for all rows in a query

I'm working on a soccer database right now, and I am trying to solve one little problem. So I have the table games, where I stored home team, away team, miscstats and boxscore: game_id | hometeam_id ...
-1
votes
0answers
7 views

Google compute engine I cannot connect to database with my database.php file despite everything looking correct

Hi there so I've been working on a little website project to try and learn how databases and html/php sites work, most of this stuff is pretty new to me but I managed to get a xampp local database and ...
0
votes
1answer
11 views

How to COUNT co-tags from a tag_map table in mysql?

I have a simple tag_map table CREATE TABLE TagMap ( TagID mediumint(7) unsigned, ArticleID int(11) unsigned, FOREIGN KEY(TagID) REFERENCES Tags(TagID) ON DELETE CASCADE, FOREIGN KEY(ArticleID) ...
0
votes
2answers
27 views

How to create a running balance column based on account number?

I have a stored procedure that returns account statement for one or multiple accounts Here is the part I have issues with: returning a running balance in each record based on account number. My query ...
1
vote
1answer
40 views

AWS iops vs disk iops?

Recently devops guy from our company told me that our local mysql stage environment are much faster than aws, because local disk has 10k iops, but our aws rds has only 500 iops. As far as I ...
0
votes
0answers
7 views

mysql queries in 2 times (select) + 1 time (Insert) verifications handle problems for db to dont create double inserts

I want to make an 2 way select verification for all users in that kind of code version: select * from table_A where other_user_id='B' if (1) -> update set response_A='1' if (0) -> select * from ...
0
votes
0answers
16 views

Bulk INSERT … ON DUPLICATE KEY UPDATE inserts only a small fraction of rows in MariaDB

I have a table like the following: CREATE TABLE `demo_upsert` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT, `Url` TEXT NOT NULL COLLATE 'utf8mb4_unicode_ci', `LastListID` BIGINT(20) NULL ...
0
votes
2answers
31 views

query to find incorrect data

A table contains valid data and invalid data. Require query to find invalid data. Valid Data: One locatorCode can contain multiple countyCode and when even one record with serviceEndDate = 12/31/9999 ...
0
votes
0answers
12 views

MySQL error when trying to import tablespace

I'm following the steps described here, but the import of one of the tables is failing with the error below. It's a large table, with a ~22GB .idb file. [ERROR] [MY-012762] [InnoDB] Page offset doesn'...
0
votes
0answers
7 views

Mysql keeps crashing with an error that seems to only be fixed once mysqldb is running

Installed mysql as part of a provided ansible script I cant keep mysql running. The only error I get is the following 2020-05-29T19:18:35.663272Z 0 [Note] InnoDB: Buffer pool(s) load completed at ...
1
vote
1answer
24 views

How mysql database performance can impact by different types of disk[hard disks]

I have a ques regarding mysql server performance which how related to server's different types of disk. I mean how disk impacting Mysql Server performance and which type of disk is more convenient for ...
1
vote
2answers
37 views

MySQL 8 - user variables within expressions is deprecated [UDF calls with lot of parameters]

I have this: SELECT @foo1 := UDF1(0, a, b, c, d) AS Foo1, @foo2 := UDF1(1, a, b, c, d) AS Foo2, @foo3 := UDF1(2, a, b, c, d) AS Foo3, @foo4 := UDF1(3, a, b, c, d) AS Foo4, @foo5 := ...
-1
votes
1answer
12 views

How to get the name of the id and name of friend in the same output in sql [closed]

So I got 3 tables and I am struggling to get name of id and the corresponding friend id's name from Students table. Many thanks!
1
vote
1answer
21 views

Make sure date of departure is different than date of arrival?

I have the following tables: Flights (id_flight) Airports (id_airport) Departures_Arrivals (id_flight, id_airport), which is the Junction Table between Flights and Airports and it has the following ...
0
votes
1answer
15 views

MySQL - Pass input parameter into Cursor query

Is it possible to pass input parameter into Cursor SELECT statement WHERE clause? For some reason I think it isn't working. I'm trying to pass _TAG and _ITEM_NAME into where clause. DECLARE ...
0
votes
0answers
25 views

MYSQL storage increasing unexpectedly (RDS)

I am total newbie to database game. & I am using mysql 8.0 RDS 20GB free tier. I don't have much data on it.(just 300 Mb) But I always get a mail that you have exceeded 85% of storage limit.(...
0
votes
1answer
14 views

Methods for tracking processing time for long running ADD INDEX call in MySQL

I've set off index creation on a very large table in MySQL and while I expected it to take a long time, I'm 5 days in and wondering if there's any way to debug potential issues or simply let it run. ...
-1
votes
2answers
18 views

Query record when N values of a column are present

I have a table similar to the one shown in snip. I want to Query all the Facility_name and Product_Id for which all 'Week' exist i.e. 1,2,3 Desired output would be only 'A' Faility_Name and ...
0
votes
1answer
22 views

Display Top X results for each unique value

I am trying to figure out how I can output any machine that has had the latest 3 backups be larger than 10GB. My SQL Table looks similar to the below table: ComputerID | BackupImageName | ...
0
votes
1answer
17 views

MySQL: change column type using expression

In a MySQL database, I need to convert some UUID columns (BINARY(16)) into VARCHAR. I want to convert them in the canonical form, not as bytes. For clarity, in lowercase and with hyphens, and not in ...
0
votes
0answers
17 views

How to “catchup” data after a backup

I need to transfer a database to another server with hopefully 0 downtime. I have Percona Mysql 8 on the destination and Mariadb on the source. I have successfully used Percona XtraBackup to create ...
-1
votes
1answer
18 views

how to display item wise count report using SQL query [closed]

I Want to write a query for a particular result I have created a table with three columns Category(items value-Water pump,cutting motor,driller) purchased Date(value-date) Working properly(value-(...
0
votes
0answers
11 views

MySQL 8 vs MySQL 5: Why wildcards misbehave in GRANTs command? [closed]

I came across with one of my old projects (using MySQL 5 and PHP 5.5). I've just wanted to test that project using MySQL 8 and PHP7.0. To install the DB i normally do: ... mysql -u root -p < ...
-1
votes
1answer
8 views

binlog not recording DML statement in mysqlcluster

I have created a MySQL NDB Cluster consisting of 2 data node, 1 mgm node and 1 mysqld for testing. Also i have created a slave for NDB to INNODB replication. My binlog are not recording DML statement ...
0
votes
1answer
21 views

Ensure integrity of other columns from foreign record

I have 3 tables: Race - id PK Racer - id PK - rank Winner - id PK - race_id FK(Race.id) - racer_id FK(Racer.id) - rank - prize UNIQUE CONSTRAINT (race_id, rank) Racer.rank is a non-unique ...
0
votes
1answer
16 views

How to split a SUM column based on another BIT column?

MySQL v5.7 Having this table: id | sprId | load | calc -----|----------|---------|--------- 1 | 1 | 1 | 7 2 | 2 | 1 | 1 3 | 2 | 1 | ...
0
votes
0answers
18 views

Migrating from MariaDB to Mysql - Duplicate Constraint Name

I am attempting to migrate from MariaDB to MySQL by doing a mysqldump from MariaDB and then restoring it to MySQL (mysql:latest docker container). I am getting the following error when importing into ...
0
votes
2answers
17 views

Index of which columns are NOT empty

I am trying to enhance the search performance of a table based on whether certain columns contain values. I have the following columns : id | link | text | date | lat | long | type If a record ...
0
votes
1answer
18 views

Remote mysql only works from my computer, but no others

I need a direct connection to a MySQL server on a remote web server. So I've added to cpanel access hosts list an IP of the computer I wish to connect to the remote web server. But I can't connect, ...
0
votes
1answer
15 views

Fetching records using some unknown join

I have two tables: 1. Users 2. Ratings Users table have columns i.e. id, name etc. Ratings table have columns i.e. - id, rate_by_id, rate_to_id etc. I want to display all the ratings in a table. ...
0
votes
1answer
25 views

Two left joins not working [closed]

EDIT: Ok, so I managed to get something but it only changes to table on the left side even though I gave 2 specific left joins. SELECT speler.Roepnaam as team1, wedstrijd.Speler2ID as team2 FROM ...
0
votes
1answer
16 views

MySQL, get rows for non-matching reference or reference does not exist in other table

MySQL, select non-matching reference or reference does not exist in other table. For example. table: category category_id, category_name 1 XYZ_1 2 XYZ_2 3 ...
0
votes
0answers
19 views

AWS RDS MySQL some time get slow performance when update table1 set field='any word' where primarykey=1234

Normally when update table1 set field='any word' where primarykey=1234 take 1sec. or less but sometimes random take much more time possible 500sec. or more. I was set very well and never see high CPU,...
1
vote
0answers
19 views

Database Design For Employee Business Hours

I have a simple employee database (I use mySql): Employee ( id int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(40) NOT NULL, email_Id varchar(40) NOT NULL, mobile_Number varchar(15) ...
1
vote
1answer
22 views

What is the correct way to define and query a 3NF Associative entity

A subset of my database contains the tables contacts, networks and networkContacts which is my associative entity. I have defined it using a composite primary key composed of the primary keys of the ...
0
votes
0answers
24 views

DB query failed: SQLSTATE[HY000] [2002] No such file or directory

Bit of background as this may be important to this error. I have a VPS and I use the Plesk control panel, I recently upgraded my VPS, which caused my partition storage to be full, this was the first ...
0
votes
1answer
19 views

How to group records under certain conditons in mysql

I would like to join 2 tables and group user records based on user id and return its overall status. Example. Lets say a user applied for a loan, he uploaded multiple documents to bank website which ...
0
votes
0answers
26 views

Which database is perfect fit for making writing application such as Pages(apple) [closed]

I want to make an application that helps writing. Clients need to write the answers to questions, or fill the blanks in the sentences. Then, those answers are needed to store in Database and can be ...
0
votes
0answers
13 views

How to Check and Repair MySQL database Using Mysqlcheck

I need repair Mysql database using Mysqlcheck command this is the guide run MySQL 5.5 Command Line Client as Administrator insert password and run mysqlcheck -r mydb the return I don't ...
0
votes
0answers
11 views

Try to run Python programm from command line. ImportError: No module named mysql.connector

I'm new in programming. So I have a question about this error. I'm trying to run programm from command line in PyCharm, and get this Error. root@kali:~# python /root/PycharmProjects/lesson/ProL3/ner....
1
vote
2answers
22 views

MySQL migration physical server VMware virtual server [closed]

How to migrate physical MySQL server to VMware virtual server with all db and user privileges
0
votes
1answer
27 views

MySQL : Stored Procedure from Trigger giving duplicate results

I have created a stored procedure to insert data into an audit table. The procedure accepts an argument that takes table name and same value is inserted into the audit table along with PK. When i'm ...
1
vote
2answers
40 views

Index creation in extremely slow in Mysql Aurora 5.7

I have a table in mysql Aurora 5.7 version . The db instance has very good configuration 488 GB ram (db.r4.16xlarge). Data base is static data base no application is running on this . I have 1.5 ...
1
vote
1answer
13 views

can I exclude or delete .pem files in backup data myqdl?

I am making a backup of the mysql data folder. In this folder are the databases. The method I am using is described in this post which uses ROBOCOPY During installation, mysql (tested in 5.7.30) ...
0
votes
2answers
14 views

Unable to run mariadb in safe mode

When I run following command mysqld_safe --skip-grant-tables & I get message myuser@myvm:~$ 200523 08:24:41 mysqld_safe Logging to syslog. 200523 08:24:41 mysqld_safe Starting mysqld daemon ...
-1
votes
0answers
27 views

Database Design for Virtual Wallet [closed]

I am designing a virtual wallet on a e-commerce website. This system has the following financial features: Customers will be able to have credit in their account and can charge their credit. ...
0
votes
0answers
12 views

Storage fluctuates when creating a table as select from another table via python

My table "test_table2" holds around 12mil records and has 6 columns with small records (short strings, dates, etc.). The size of the table is cca 1 GB. When I'm running this query: create table db....

1
2 3 4 5
376