MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
51 views

GROUP BY Returning Different Totals [closed]

I have two very similar queries that are returning different totals. The first query, where the total [of subscription_payment.price] is calculated with PHP (and verified in Excel), is the same query ...
1
vote
1answer
40 views

How can one drop all default values and allow NULL for all columns of a table?

I'm working on a PHP script to modify the primary key (PK) of a table. My current code is: $q = "SHOW KEYS FROM $db.$table WHERE Key_name='PRIMARY';"; $keys = Query ( $q); if ( $keys) { $q = ...
0
votes
1answer
26 views

mysql french documentation [closed]

I am not able to find a translation for Mysql documentation http://dev.mysql.com/doc/ I read English quite well, but it is not the case for all my colleagues.
0
votes
1answer
27 views

Mysql crashes in amazon linux

We are trying to drop tables from mysql that is installed in amazon linux which the os is not able to handle and is very slow, mysql crashes as well or goes to the defunct mode. We have tried to ...
0
votes
1answer
26 views

MySQL replication mystery

May I ask if its possible to have a table on Slave server. But it does not exist on Master Servers? how come this one happens? Thank you.
0
votes
1answer
27 views

What's the approach to figure out reason for mysql crash?

The database I'm using crashes a lot recently. And I can't find a decent way to dig into the issue. I looked into mysql error log, but don't know how to start. I know there was a "load data infile" ...
0
votes
1answer
20 views

MySQL Cluster Replication Merge

We'd like to have two MySQL cluster groups, and at the same time have replication set up between them. Is that possible?
0
votes
1answer
32 views

large SQL Performing quite slow (roughly 2 seconds for 290 rows) when having to deal with entries that can be NULL

SELECT version_stamp, pscdesc_id, psc, pscdesctext FROM pscdesc_history WHERE ( psc IN (SELECT psc FROM pso_history AS c ...
1
vote
1answer
119 views

IF statement in ON clause

Can you help correct the syntax for this code? INNER JOIN Users u ON case when c.sender = ? then c.reciever = u.id else c.sender = u.id How do I do I put a CASE statement in a JOIN clause?
2
votes
2answers
48 views

Cannot ALTER TABLE

I have a particular table that I cannot add a key for: mysql> ALTER TABLE tasks ADD KEY `fruitful_user_count` (`user_id`, `is_fruitful`); ERROR 1034 (HY000): Incorrect key file for table 'tasks'; ...
0
votes
0answers
8 views

Complex query for AVG and Sport values

I have problems selecting the expected data: Table: id |timestamp |stat |val1 |val2 1 |2014-05-05 16:52:23 |<00033>|83,3233 |79,1; 2 ...
1
vote
2answers
61 views

Mysqldump from production database, every morning

Our Db is about 2GB in size. We run a scheduled job at 3am every morning, when traffic is pretty low, where we export the whole db and sftp it off site. Is it bad practice to do this on a production ...
0
votes
1answer
24 views

What would be most elegant way to replicate data contents periodically into a MySQL table?

I need to parse contents from an API route and insert into a MySQL database. The aim of parsing contents is to replicate the data from the API to my database table. I need to check API response every ...
5
votes
2answers
232 views

How do I create a user-defined aggregate function in MySQL (redux)?

OK, I'm probably going to get banned for asking the same question a second time, but I'm an incredible newbie here and I was told I don't have enough of a reputation to comment on the original ...
1
vote
1answer
36 views

MySQL/Percona Server is taking long and I'd prefer to skip all this waiting even if it means data loss

Originally posted to https://www.facebook.com/groups/GNUAndLinux/permalink/10155020539805019/ but no replies received. I run Percona Server 5.6.21-70.0-688 x64 on Ubuntu Server 12.04 LTS x64, 64GB ...
1
vote
2answers
28 views

Index and rows placement within database files

Where are the indexes and data tables stored within a physical database file or a page of a physical file : Can there be different rows from different tables in the same physical page ? How does ...
0
votes
1answer
39 views

Help improving this query using IN

Have a look at this query. Is there anyway of making the IN-statement a JOIN instead? Yes, I'm quite new to this. Thanks in advance for any help. SELECT * FROM company AS t1, employee AS t2 WHERE ...
0
votes
1answer
35 views

DB/table design help [closed]

I have 50,000 unique cards in a table. A minimum of 2 cards and up to 20 cards can be chosen by the user and they can write a blurb about it. There will be times when the cards chosen by different ...
0
votes
0answers
11 views

mysql get IDs wich have the same value

in my project i'm trying to answer aquestion in mysql wich is: what are the ID wich have the same value given the example table: test ID | value 1  | 1 2  | 1 ...
0
votes
1answer
17 views

Should I use one-to-many or many-to-many to log previous records?

I have 2 tables, company and interns. the initial relationships are, An intern belongs to only one company. A company has many interns I have a slight problem with these relationships. If the ...
0
votes
1answer
16 views

Restricting the # of Rows a User can return in a single query

A concern has come up recently about employees who have read access to our internal databases being able to download large amounts of data for nefarious purposes. My question is whether it is ...
4
votes
2answers
42 views

SQL to select all siblings with specific child

I have a simple parent-child hierarchical arrangement using two tables: Assemblies (parents) and Parts (children). An assembly consists of one or more parts. | AID | A_NAME | |-----|------------| ...
1
vote
1answer
29 views

enum vs boolean in case of multiple yes/no fields

I want to store information from a form where there are multiple yes/No question. For those how should I create table fields? I have experienced mysql doesn't support multiple columns to have same ...
0
votes
1answer
34 views

How to filter specific entries from a MySql table

I have a MySql table and it has following values. Table name results. Reg.No SubjectCode Attempt Pass/Fail 112108 CMIS 1113 1 fail 112110 CMIS 1114 1 ...
0
votes
1answer
18 views

Preview the increment in a Mysql table size before running the ALTER TABLE ADD COLUMN statement

Is it possible to preview how much the table size will be incremented by an ALTER TABLE ADD COLUMN statement before running the statement in the database?
0
votes
1answer
28 views

Fulltext search not working properly

I have pers table and applied combine fulltext index on (prenom, nom) fields. Below are data in that table. persID prenom nom (pers table) -------------------------------- 116 te te ...
0
votes
1answer
11 views

Filter and then sort products by availability

I have table with products. Each product can be avaible in 1+ suppliers, so product can be present multiple times. products - id_productSupplier (primary key) - id_product (foreign key) - ...
1
vote
2answers
34 views

Mysql fulltext index search returning weird result

I have ingredient table. I want all those recipes which have certain ingredients. Below is my table structure. Table(ingredient) - Applied fulltext index on ingredient column. ...
1
vote
1answer
58 views

Why mysqldump is returning with error 1143: Couldn't execute 'show table status like

I ran the following command to create a mysqldump mysqldump -ubackup -psomething --single-transaction --quick somedatabase | gzip > 4_19.gz I got following error after 60% (estimating checking ...
0
votes
0answers
31 views

MySQL: Optimize query with a range and distinct count

I have a query on a large table with millions of rows that looks like this: SELECT COUNT( DISTINCT clicks.tx_id ) AS unique_clicks_count , clicks.offer_id FROM clicks WHERE ...
-1
votes
0answers
30 views

How index work in case of write operation?

We have two cases:- Insertion :- Cluster Index:-- Insertion :- we have number of user which we doing insertion new records. For .........example 27 users had inserted 27 rows in 1 ...
3
votes
0answers
32 views

Best database replication technique for a very unstable (power wise) network

I am part of a small network (500 users) who are all connect via WiMax to each other. The people connected to this network live in about a 70 km radius. This network allows for a transfer speed of ...
0
votes
1answer
47 views

Many mysql queries stuck at sending data

I am using opencart and I can se many queries blocking the mysql server. All queries are the same except the p.manufacturer_id. Attached there is the query and the explain of the query. The query is ...
0
votes
4answers
40 views

Single SQL query to retrieve data in a particular order (not ASC/DESC)

I have a MySQL table, let's say called reviews review_id, product_id, language_id, rating, review, author language_id ranges from 1 to 10 for 10 different languages. Let's say I determine that my ...
2
votes
3answers
62 views

Drop Tables with Bigger size

We have a mysql database with a size of 2 TB, in which we have for to five big tables ranging from 110GB to 350GB. When we try to drop these tables the mysql goes to the defunct mode and hangs in that ...
0
votes
1answer
23 views

dropping tables with bigger size [duplicate]

We have a mysql database with a size of 2 TB, in which we have for to five big tables ranging from 110GB to 350GB. When we try to drop these tables the mysql goes to the defunct mode and hangs in that ...
1
vote
1answer
23 views

Limit distinct count of group by

Suppose for simplicity that I have a table t with columns id and value. I can find the ids that have more than one distinct value using a query such as SELECT id, COUNT(DISTINCT(value)) AS count FROM ...
0
votes
1answer
14 views

stress-testing MySQL slave with master's queries

A MySQL host in a slave configuration is in the testing phase before being put into production as a primary server for a specific workload. To make an estimate about how it is going to perform, the ...
0
votes
0answers
10 views

mysqldbcompare showing AUTO_INCREMENT differences but there are no missing records

I am encountering a strange issue when using mysqldbcompare to compare two MySQL DBs(one is a master, the other its slave). I noticed that the tool notes that the AUTO_INCREMENT values of this ...
1
vote
4answers
79 views

How to backup live mysql database?

I have 12 GB MySQL InnoDB Database with around 800 queries per second. No sooner I start 'mysqldump' over it to make backup I start getting '503' on my website. How do I make backup of my live ...
1
vote
1answer
20 views

MySQL join for two queries

I have the following two queries... mysql> select id, title from events; +----+-----------------------------------------------------------------------------------------------+ | id | title ...
0
votes
1answer
22 views

How to get Location name from Hierarchical data in Mysql

I have table Location like this: ID, PID, Location 1 NuLL Country 2 1 City 3 2 County 4 3 District 5 4 Social How can I make a view in MySQL that ...
0
votes
1answer
31 views

Blob datatype issue with log file

I am getting continuously below error message in mysqld.log [ERROR] InnoDB: The total blob data length (10152274) is greater than 10% of the redo log file size (3072). Please increase ...
0
votes
0answers
13 views

utf8 vs utf8mb4-noone allows entry of every character

i am trying to store different types of languages in mysql and utf8 allows me to do so but when any images are there in that content utf8 breaks at that moment and only partial content is being ...
0
votes
0answers
25 views

Optimize join query involves 5 tables

EXPLAIN SELECT a.year, a.month, e.large_classify_eng, e.middle_classify_eng, g.bu_detail_order, g.bu_detail_enterprise_name_eng, a.service_id, SUM(a.money_amount) AS money_amount, ...
0
votes
0answers
34 views

MySQL won't start - e44 InnoDB: Assertion failure in thread 3652 in file fil0fil.cc line 5594

MySQL 5.6 is installed on my Windows 2008 server. The service is refusing to start. The error log reported: 2014-12-02 20:27:16 1664 [Note] Plugin 'FEDERATED' is disabled. 2014-12-02 20:27:16 634 ...
0
votes
0answers
30 views

Best practices for storing a small list of booleans

For a new application, I am designing a schema in MySQL to hold the data. It manages document information, with many optional attributes. Among them are lists of 3 to 5 boolean values (checkbox lists ...
0
votes
1answer
49 views

Need help in increasing maximum table size

Two of the tables vb_post, vb_profilevisitor getting corrupted again and again. The hosting company suggested the following: Looks like the problem is that the .MYD table was converted to a .TMD ...
3
votes
2answers
73 views

Why wouldnt Mysql use index on the Primary query in a nested query

I have two tables: search_criteria and pricing. There is an index on search_id column in search_criteria table and on pricing_id column in pricing table. But running this nested query does not use ...
2
votes
1answer
29 views

innodb_thread_concurrency vs slave_parallel_workers

I am new in rds, but I am facing server performance issue. I got these two variable but I am confused what exactly is difference between innodb_thread_concurrency and slave_parallel_workers.