MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
22 views

Tmpfs for mysql tmp dir questions

I have a 768M tmpfs dir that I use for mysql temp directory. It occasional fills up when running reports on large date ranges. When this happen the report fails and I get an error 28. This actually ...
0
votes
1answer
46 views

Performance of MySQL BLOB fields processing

Suppose, I have large (about 1 GB) strings in ASCII encoding. I have to choose whether to store them as separate blob fields or split each one of them into smaller pieces and then store them as ...
0
votes
2answers
30 views

What is an easy query to fix up historical columns valid_from and valid_to?

I have a table with typical history rows using valid_from and valid_to dates. My table might look like this: | id | object_id | name | valid_from | valid_to ...
0
votes
1answer
15 views

SQL CHANGE DATE FORMAT IN BULK

I have a database with several hundred fields but my data structure is wrong. It is currently in uk format as follows: d/m/y 01/01/85 01/01/96 23/12/87 What would be the most efficient way to change ...
0
votes
1answer
52 views

Database : what design to point on two possibilities?

I am designing a datamodel for a new project. One of the requirements specifies that some objects can point either a person or a company. What is the smartest way to achieve that? I have thought ...
0
votes
0answers
40 views

Temporary table not supported in MySQL Cluster

I am new to MySQL Cluster and as I don't have opportunity to try it now I am interested in one thing. In the official pages of MySQL Cluster, there is a statement about temporary tables for NDB ...
1
vote
1answer
30 views

How can I remove references to tables after removing .frm files?

So I had a bunch of csv files in my /var/lib/mysql/imports directory for importing into mysql tables I had created. To clean up the folder I deleted all the files in the directory (incorrectly ...
0
votes
4answers
30 views

Aggregate data from two tables with different field names

I have two tables that each have date and amount fields. This is for a donation system so one is pledges and the other is donations. Here are the structure of relevant tables and fields: pledges ...
0
votes
1answer
25 views

Usage of non standardized queries

So this is more of a theory question than practical but I'd appreciate any help. My friend and I are doing a project to learn new stuff and have fun. He's a coder and I like to think that I'm good ...
0
votes
1answer
24 views

MySQL tmp and tmpfs disk

I have mysql and i use a tmpfs disk that is 768 M. Mysql uses about 70% of the memory. There is about 1170 M available. If mysql uses ram to the point there is less than 768; will my RAM disk be ...
1
vote
1answer
37 views

How to edit data to 2 tables using MySQL Workbench

How to edit data in 2 tables using MySQL Workbench (or can I)? I use the below query to get the data but unable to edit it from the table (or Form Editor). SELECT * FROM TABLE1 ...
0
votes
0answers
20 views

Add Row To table on update Trigger

okay trying again. I have a trigger that I want to fire off whenever my order status changes to 'wc-processing'. So that My trigger doesnt copy ALL data onto this new table (vr_key) I want to use a ...
-1
votes
1answer
21 views

How to data transpose in sql view?

Table1 Name CITY RANK Manish New delhi A Akash New delhi A Akash Aligarh B Vinay Barh C I have to transpose like Name New Delhi Aligarh Barh Manish A ...
0
votes
0answers
15 views

How to calculate complaint close time in hours and skip non working hours

**complain_id date_created date_closed** 1005 03/15/15 15:00 PM 03/16/15 11:00 AM I have to calculate complaint close time in hours and skip non working ...
1
vote
1answer
18 views

extract all unique chars from all texts across the table

I have a huge mysql table (20 columms by 320.000 rows) that contains a lot of text from a lot of languages and the problem is that I need to identify all the unique characters in that table. For ...
0
votes
0answers
18 views

How to get records in group when records are duplicated?

I have following table structure. Here id is primary key and auto incremented.Here Records are duplicated and id with 1 is parent records and id with 2 & 3 are its child records. same with id ...
1
vote
2answers
29 views

MySQL databases on their own separate Logical Volume

I'm looking for a way to keep MySQL database sizes within certain limits. That's why I was thinking about creating a logical volume for each database. So for example: db1 => lv_db1 (5 GB) db2 => ...
0
votes
1answer
30 views

building structure for employee office relation

I have a table defined like this empid fromdate todate office_ID 1 2012-03-01 2014-04-2 1 1 2014-04-03 ---- 2 2 2012-03-01 ...
0
votes
2answers
28 views

MySQL replication - ibdata1 huge

I'm trying to implement MySQL replication in production after I successfully implemented it on my dev environment. Basically, what I did is export the dump using the following : mysqldump ...
0
votes
1answer
28 views

MySQL Data Synchronisation from different Databases in C#

I am supposed to create a C# solution to compare the data (table, column and row) from two different databases and update the 2nd one as follows: 1. with just the rows that are updated recently ...
1
vote
1answer
136 views

MySQL FULLTEXT search not returning any results

I'm wondering why my fulltext search isn't returning any results. To me this seems pretty straightforward, but alas it's not working. I'm far from a DBA, but looking at the EXPLAINed query, I see ...
0
votes
0answers
27 views

Cannot open table slave_master_info

I have a dabatase working on InnoDB engine Now it is damaged. I can´t open any table, it shows error 1146 Table 'database.tablefromdatabase' doesn't exist I tried innodb_force_recovery with all ...
1
vote
2answers
30 views

Schema to make a Payment History/Viewing History

On some websites I have seen two history of events: Payment History and View/Watched History. I want to have both payment and viewing histories in my app, but I got stuck when I started thinking ...
3
votes
1answer
69 views

Optimizing Join between a very small and a very large table

I have two tables: CREATE TABLE `TBL_REPORT` ( `ID_TBL_REPORT` bigint(20) NOT NULL AUTO_INCREMENT, `INDEX_NAME` varchar(100) NOT NULL, `INDEX_VALUE` varchar(100) NOT NULL, ...
0
votes
2answers
35 views

fixed length table

I only have ever used mysql and storing data on .txt files. Currently I'm working with tick data (I have node.js on my server). My custom setup so far stores a fixed amount of tick data as comma ...
0
votes
1answer
38 views

MySQL - How to replace a given value from multiple columns when using SELECT?

I need to SELECT a set of rows of a given table whose structure looks like - 1º line is the name of columns A01 A02 A03 A04 A05 ... A200 99999 99999 10 753 99999 ...
1
vote
0answers
22 views

Very weird Innodb Corruption Issue

I'll try to keep this to the point. System: OPenVZ VPS, debian 6, 512 MB RAM, 50 GB HDD (25GB free) I have a mysqldump dump file (3GB), that was created when the innodb database was working fine. ...
0
votes
0answers
44 views

MySQL denying access to user with necessary privileges

I have a MySQL server and a user with access to all databases. When this user attempts to connect to the database and execute a query, access is denied. I have ran the following statement (specifics ...
1
vote
1answer
21 views

MySQL: Replicate data within 2 same schemas on 1 mysql server

This might sound a bit crazy, please let me explain the reasoning behind this: we plan to use a real master-slave replication for production we want to use something small'n easy for local ...
0
votes
0answers
25 views

Unique indexes on table with multiple columns

I have a table called organogram: SHOW CREATE TABLE organogram: CREATE TABLE `organogram` ( `organogram_id` int(11) NOT NULL AUTO_INCREMENT, `locatie_id` int(11) NOT NULL, `afdeling_id` int(11) ...
1
vote
0answers
32 views

How WHERE works with column name only?

I have table with varchar column. Some rows are empty, some have content. While preparing SELECT statement, I accidentaly run query like that: SELECT column_x FROM table_x WHERE column_x; It gave ...
0
votes
0answers
28 views

CPU jumps massively and stays high, under very light load

We had two separate RDS instances exhibit the same pattern today. This was both during low load times, one during the lowest load time for that server. They both started at almost the same time. No ...
0
votes
0answers
20 views

Automysqlbackup fix error “Skipping the data of table mysql.event. Specify the --events option explicitly”

I need to fix the mysqldump warning "-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.". I found that its because of not specifying whether or not to add ...
2
votes
3answers
43 views

How to synchronize two MySql tables using command line

I have two tables in the same database (MySql) where one has been populated and there are data been added to it frequently. I want to have the data added to the first table to be present in the ...
1
vote
1answer
16 views

Query data from two tables and substitute foreign keys of first table with values of second [closed]

There is data table mysql> select * from data; +----+--------------------------------------+ | id | uid | +----+--------------------------------------+ | 1 | ...
0
votes
1answer
45 views

Hi disk I/O and crash when turning on sync_binlog in MySQL

I have a MySQL master server (MariaDB 10.0.17) that have a very odd behavior. It has one slave fetching data from it. When I set global sync_binlog = 1, the server I/O goes very high and after some ...
0
votes
1answer
54 views

MYSQL any way to improve this query's performance?

MYSQL version 5.6.23 CENTOS 7 Hi, I have the following query that is coming from an application that I am hoping to make more efficient from the mysql side of things. I have an index built on ...
0
votes
1answer
31 views

MySQL: Capture every 5 values from column a in Table A to create one row in Table B

I have submissions of a form from a web page records in a database. the table has the following schema submit_time form_name field_name field_value field_order file the form has 5 fields, ...
2
votes
2answers
27 views

Geo localized database RTREE

I'm using MYSQL V5.6.24 GPL I have a database with 200K rows and growing and I'm trying to get the nearest, based on points. I have all the database in InooDB, and to use Spatial data, I create one ...
0
votes
0answers
12 views

How to do updates on all rows at every button click [migrated]

I have a python app that has an admin dashboard. There I have a button called "Update DB". (The app uses MySQL and SQLAlchemy) Once it's clicked it makes an API call and gets a list of data and ...
0
votes
1answer
24 views

Sumed all which has been summed [duplicate]

Is it possible to sum all row which has been summed? For instance I have this query: SELECT SUM(registered) AS `totalOftheDay` FROM table WHERE DATE(ds.register_time) BETWEEN '2015-03-01 ...
2
votes
2answers
197 views

MySQL - How to check whether all values of a given SELECTed row are equals? [closed]

Using MySQL, how can i SELECT all rows whose values are equals ? For instance, suppose a SELECT of a given table as follows COLUMN_A COLUMN_B COLUMN_C ... COLUMN_N 1 2 4 ...
1
vote
1answer
33 views

Student Attendance, null not returning [closed]

My question is based on the answer given here Attendance: id | student_id | date | ------------------------------ 1 | 2 | 2013-10-24 | Students: student_id | student_name | ...
3
votes
3answers
104 views

How to interpret correlated subqueries?

EDIT: Both answers are great but I think I must clarify my question. NOTE: I must indicate that in the following, by executed, I mean logically. I understand that the actual execution made by the ...
0
votes
1answer
23 views

Gotchas converting latin1_swedish_ci to utf8mb4_unicode_ci

I have a MySQL 5.5.31 database which has approx 220 tables - of these 220 tables, around half of them are already using utf8mb4_unicode_ci but the "older" tables are still using latin1_swedish_ci. The ...
-4
votes
0answers
22 views

stored procedure not working

i am running this one on mysql phpmyadmin. DROP PROCEDURE `gettree`// CREATE DEFINER=`root`@`localhost` PROCEDURE `gettree`(in team_id bigint) BEGIN declare count bigint; declare tmp_team_id ...
1
vote
1answer
60 views

updating same column as in the select query

When I try to do this, I get an error saying I cannot use the same table in where select as the column that I am updating. UPDATE table_name SET quantity = 19 WHERE productID = 148357 ...
0
votes
1answer
31 views

InnoDB Table has backed up INSERT and UPDATE queries, high CPU

I am running an MySQL DB with all InnoDB tables. I often have many queries backed up for the same table when I run SHOW PROCESSLIST; Basically, I keep a table of every logged in customer and update ...
0
votes
2answers
77 views

Query that was working on MySQL is not working on PostgreSQL

I had the following query (with bin_number being a string) which was working on MySQL 5.5: Postgres - was working on MySQL and doesn't work on PostgreSQL SELECT "menu_items".* FROM "menu_items" ...
6
votes
1answer
743 views

SQL Query challenge

I have what seemed like an easy query to write, that really has me stumped - can anyone help me please? So this is really easy on paper, but I can't translate it into SQL. Lets say you have some ...