Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
1answer
25 views

How to Insert 0 in the Existing table

table studentinfo: TID BADGEID NAME Location Addr 122 233.01 Katy GA GA-54 123 234.02 tery GA GA-54 I want to insert 0 ...
0
votes
2answers
33 views

Upgrade Antelope to Barracuda on Slave

I received a Last_Errno: 1118, Last_Error: Error 'Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row ...
0
votes
1answer
20 views

How to read the MySQL Audit.log file in a SQL table?

I tried to read the Audit.log file of the MySQL Enterprise using a table or other more friendly format and easy to access and understand, but the xml format with which it is written has an irregular ...
1
vote
1answer
18 views

Moving MAX and MIN calculation into a sub query to preserve the full result set in the outer query

The query's objective in brief is to list all the posts according to its score, which is calculated according to a calculate scores of date, views, and rating The problem with the query is that it ...
2
votes
1answer
27 views

How to query all entities associated with all children (recursive) of a node in SQL?

This question is about SQL in general. Answering specifically for MySQL would be helpful but not necessary. Ok, I’m having trouble putting this into words… so bear with me. Say I have a tree of ...
0
votes
0answers
7 views

MySql slaves on Amazon EC2 RHEL 7.6 server not getting connected automatically after mysql service restart on master

I have setup MySQL Master - slave replication on Amazon EC2 instance. OS : RHEL 7.6 MySQL Version: 8.0.13 Master server IP : 192.168.1.128 Slave server IP : 192.168.1.129 I have two EC2 instances on ...
0
votes
1answer
18 views

SQL enforce value of a column if other column is NOT NULL

I'm having a hard time to explain this so let me illustrate it with an exemple. I have a table for comments and it looks like so: CREATE TABLE comments ( id INT UNSIGNED AUTO_INCREMENT, ...
0
votes
0answers
15 views

Row level user privileges help with design [closed]

Say there are 2 tables Project and Task. How can I design Privileges table and assign permission like read/write/update/delete for each project/task from the above tables. Should I create two ...
0
votes
1answer
31 views

CASE in WHERE clause in MySQL

I'm working in a project with MySQL and using stored procedures to make my SELECT queries, so all of them have this same structure: DELIMITER $$ CREATE PROCEDURE `case_in_where`(IN `column_selector` ...
0
votes
0answers
20 views

Reverse the order in the table derived from lateral join

Example table: CREATE TABLE `level_2` ( `id` int(11) NOT NULL, `comment_id` int(11) DEFAULT NULL, `comment_parent` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `user_name` varchar(...
0
votes
1answer
24 views

Is query executed when mysql server has gone away?

How can I be sure that a query was not executed? For example, I try to execute update `table` set `a`='b' and got the error 2006 server has gone away
0
votes
1answer
31 views

combine two select queries?

I have two Mysql select queries: select TTS.SSML, TTS_TAG.SORTID, TTS.VoiceId , TTS_TAG.TAGID FROM TTS left join TTS_TAG on TTS_TAG.TTSID = TTS.TTSID where TTS.MID = 15 select max(TTS_TAG.SORTID) ...
0
votes
1answer
54 views

mariadb 10.3.13 table_open_cache problems

Just upgraded mysql 5.6 to mariadb 10.3.13 - now when the server hits open_tables = 2000, my php queries stop working - if I do a flush tables it starts working correctly again. This never happened ...
1
vote
0answers
25 views

Got an error reading communication packets on writer instance only

So I am connecting with aurora MySQL 5.7.12-log with Django. Below (1) is the query auto-generated by Django when I hit runserver. SELECT `django_migrations`.`app`, `django_migrations`.`name` FROM `...
0
votes
1answer
29 views

Percona Xtradb cluster 56 node 2 rejoin cluster failed

I have following DB cluster: Node 1: Percona-XtraDB-Cluster-56-5.6.39-26.25.1 Node 2: Percona-XtraDB-Cluster-56-5.6.39-26.25.1 Node 3: Percona-XtraDB-Cluster-56-5.6.41-28.28.1 I start in order ...
0
votes
2answers
25 views

Design db for different type values for same purpose [closed]

I've to store either a text box value or a select box value in a database. Scenario is below There will be a temporary tutor for a student. Either internal from school or someone from outside. The ...
0
votes
1answer
32 views

Error: “A slave with the same server_uuid/server_id as this slave has connected to the master”

I am testing a node.js client which connects to a mysql DB (mariadb). It works fine on its own, but if I launch this client simultaneously on another host, the first instance gets disconnected with ...
0
votes
1answer
23 views

Importing True/False as tinyint failing when last field

Here is a line from the file I am loading. "dev"|"APSET3454"|"apset3454.xxx.xxx.xxx"|"TWS01"|31111|True|False|False|"1"|True|"Win2012R2 64 bit ESC:712482-2267174 IEMID:84520"|"2017-12-20T15:06:15.390+...
0
votes
1answer
12 views

Can I shed permissions during a session?

I am creating a reporting server which will run certain reports. The reports are created by me and saved as SQL files. The reporting application has read/write access, for good reasons. Is there a ...
-1
votes
1answer
31 views

Incorrect string value: '\xF0\x9F\xA4\x96<b…' for column 'body' at row 1 [closed]

I've set the column type to utf8mb4 and the collation to utf8mb4_bin. The table defaults are also utf8mb4 and utf8mb4_bin. When I use SequelPro to add the emoji "🤖" to the database manually, it ...
1
vote
1answer
36 views

Is there a way to store int in ObjectID? [closed]

I'm trying to migrate MySQL user ids to MongoDB. user ids are incremental values like 1,2,3,4... Is there a way to store int in ObjectID?
0
votes
0answers
7 views

I am trying to import mybb Database through phpmyadmin but failing?

I have made the database through cPanel. Now I am trying to import it in my wamp server. But everytime I try only 22 tables gets imported and others don't. How to fix it? My file isn't that big in ...
1
vote
1answer
26 views

How can I recover all the Stored procedures, Functions, Events from previous server version

Until recently I have been running MySQL5.5.8 - foolishly a couple of days ago I decided to upgrade to take advantage of new features to be found in version 8. Before the upgrade I did a backup, using ...
0
votes
0answers
38 views

Transaction on defriend and multi databases

I have a big issue when i'm working with multi database and diffrent databases as same time. The problem is that I'm working with mssql, mysql and mongodb at sametime, and what I need is a way to be ...
0
votes
1answer
22 views

how to structure availability relationships

I am building a recruitment database and need to structure 'current availability' data against candidates which can be one of three options - available now, a specific date (e.g. 5/3/2019) or a ...
0
votes
2answers
48 views

Mysqldump multiple tables with where clauses in single transaction

Suppose, we have 2 tables: t1,t2 in database db: Expected the below code to dump tables based on conditions specified in the where clauses: mysqldump --login-path=login_path \ --single-...
-1
votes
0answers
21 views

Sync MySQL (MaraDB) databases through github

Is there a way to be able to sync multiple database through text files on github? This is for an open source project I am considering and need a way to have local databases to sync on demand. I ...
0
votes
1answer
30 views

MySQL How to calculate Partnership Scores from Cricket ball by ball database [Solved]

I'm trying to create a simple cricket application, where i will store all cricket records from a database. I collect a sample database with data from online and i successfully did some query but I'm ...
0
votes
0answers
6 views

mysqldump and mysqlcheck not returning any output

Because I am unable to start the mysql daemon, I have edited my my.cnf files so that innodb_force_recover=6. Now I am able to start the mysql daemon. I guess the data are corrupt somewhere so I am ...
0
votes
0answers
22 views

MYSQL #1146 : does it mean the data was lost?

I delete WampServer with all databases and install a new version (AppServ) with php,mysql,apache before I deleted it I copy the wamp64 folder to D:\wamp64 then I just move the folder D:\wamp64\bin\...
1
vote
1answer
71 views

MariaDB 10.1.38 - Specified key was too long; max key length is 767 bytes

I have a table that has 3 columns: id(int 11) | user_id(int 4) | title(varchar 512) ____________|________________|___________________ 1 | 3 | Thing X 2 | 3 ...
0
votes
2answers
44 views

MySql | How to compute this [closed]

I have this table Grade Lec Lab 1.5 3 0 1.5 3 0 1.5 2 1 The formula will be like this 1.5 * 3 1.5 * 3 1.5 * (2+1) = 13.5 / ...
0
votes
1answer
47 views

Indexing VARCHAR column?

Should I add INDEX to my VARCHAR column? I need to select rows with a string, not with ID, will it speed my queries? Example: SELECT * FROM `cities` WHERE `slug` = 'new-york';
2
votes
1answer
29 views

JOIN Call table to grouping by Origination and Destination

It's a call system. tables structure and data sample : tbl_countries CREATE TABLE tbl_countries ( country_id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, country varchar(100) NOT NULL ); ...
1
vote
2answers
46 views

MySQL hitting IOPS wall in AWS, not able to utilize full volume IOPS level

We are scaling up an existing MySQL 5.6.41 (with Galera) based system running in AWS on EC2, and are hitting a wall in performance, which we believe is narrowed down to storage IOPS. Please note for ...
0
votes
2answers
45 views

MySql | How to compute every row in same table

I have this table Grade Lec Lab 1.50 3 0 1.50 3 0 1.50 2 1 The formula will be 1.50 * 3 1.50 * 3 1.50 * (2 + 1) = 13.5 The results will divide to total number ...
0
votes
1answer
25 views

csv engine and mysql start

my question is about speed when perform service mysql start. with many tables (some not often used). what engines consumes more or less start time ? example: innodb --> the more tables, the more ...
0
votes
1answer
21 views

Interpret DBT2 results

I'm testing experimental storage (so I expect the numbers to be bad / far off). I ran the test on the experimental storage and got this: Response Time (s) Transaction %...
0
votes
1answer
18 views

Batch query a lot of MySQLdump files

I have a website for an event. I set up a cron job to back up the database every hour. The backup command is mysqldump -u"$DB_USER" -p"$DB_PASS" --database "$DB_NAME" >"${OUTPUT_DIR}/${DB_NAME}.$(...
0
votes
1answer
23 views

Fetch records only for today's date by using PHP & Mysql

I have a column in my table as date and time format like YYYY-MM-DD HH:MM:SS And i want to fetch data which was stored on current date only, everyday I'll be getting data for 24hrs only,
-1
votes
2answers
31 views

Upon deletion I want to set another value that is in the table (random) as the foreign Key, if i delete that foreign key, how can i do this?

For example, I have a database that has coaches and gymnastics, if a coach leaves the squad then every gymnast they are assigned too need to be randomly set a new coach. This needs to be done in SQL ...
0
votes
2answers
20 views

Sorting ranking by trigger

I create a game in which players will gain levels. The basic information is in the table "char" (nickname, lvl, exp, money ...). I want to make a ranking that will be updated on a regular basis and ...
2
votes
1answer
108 views

How to join 2 tables in mysql but with different values in one of the tables

I have 2 tables(as shown by the image below) inbox_messages_table and users_table So what i am trying to do is combining the 2 tables ON user_id but in my inbox_messages_table i have an id which i ...
0
votes
1answer
17 views

Why does the column content say “Array”?

I got this problem when I'm doing mysql that every time that I post pictures on the blog it will say to the database that I got array on image column. it is supposed to have the image that I inserted
1
vote
1answer
15 views

Select data with a join

I just started learning SQL now and trying to figure out this scenario: We have 3 tables: Clients (ClientID, Name, Surname, Age) Products (ProductID, Name, Price) Purchases (PurchaseID, Date, ...
0
votes
0answers
15 views

mysql - Relational database design for language dictionary references (primary, secondary, tertiary) approach?

I have a project where I am making the Ancient Egyptian language dictionary. For this dictionary, besides words and translations, I want to have a reference for every entry, so the dictionary can be ...
0
votes
0answers
9 views

How to run a large number of SELECT queries using mysqlslap

I've been looking at using mysqlslap to simluate a large number of select queries against one of my databases. But no matter what options I use, it always seems to be stuck at either 9 or 10 SELECT ...
0
votes
1answer
39 views

How to efficiently design Firebase database for Home service Booking application? [closed]

I'm planning to build my own app. It's a home service App to link users with other providers. I'm recently used a NoSQL database, Firebase, and I am stuck with the design of the database for my app. ...
0
votes
1answer
21 views

Moving MySQL databases/folder to another disk

I want to separate MySQL database from the OS (Ubuntu) disk by moving the entire database to an exclusive HDD (M.2), and update the database folder in my.cnf. My question is: when the MySQL folder is ...
2
votes
1answer
140 views

Memory leak in MySQL 8.0.15?

The MySQL 8.0.15 the server runs after a while [~1 week] out of memory. SLES 12.4 MySQL 8.0.15 5 GB RAM [before the VM ran with 3 GB for months without any problem]. 24 cores Running SELECT ...