MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
1answer
49 views

DELETE seems to hang

The following command: DELETE FROM hours WHERE id IN (SELECT id FROM holdkey WHERE persons_id=60) seems to hang indefinitely. However, the corresponding SELECT * command completes in a fraction of ...
0
votes
0answers
11 views

MySQL Enterprise Backup Upgrade Error

Today I am upgrading my MEB from Version 3.9 to 3.11. But I got this error. Do I need to upgrade it to MEB 3.10 for me to proceed upgrading to MEM 3.11? Or its needed to install the depedencies ...
0
votes
0answers
20 views

mysql replication not working [closed]

I have a problem with mysql replication which I've set up almost 2 month ago .. Here are the snapshots from phpmyadmin : http://i.snag.gy/xrEzW.jpg http:/i.snag.gy/Pa0Uo.jpg ( first problem ...
0
votes
1answer
16 views

Sync MySQL with SQL Server 2008

My current project requires a form on my website to populate a table in a MySQL database with data a user submits via the form. This will work great but my complete goal involves getting that data ...
-1
votes
1answer
31 views

Migrating Data to A New Database Schema [on hold]

I'm rewriting a site that has old procedural code with nested includes and a database schema that is just as impressive... lol Anyway, I'm nearly finished with my rewrite but am unsure about how to ...
1
vote
1answer
16 views

Cannot Run SQL INSERT in MySQL

Neither [vagrant@localhost ~]$ sudo mysql -e "USE books; INSERT INTO authors (id,name,email) VALUES(1,"test","test@gmail.com");" ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; ...
0
votes
0answers
12 views

MySQL: is there a way to make a self-referencing join recursive?

I need to insert some records derived from relationships in the same "pivot" table. We have a products_to_products table which stores relationships between products. Here's a simplified example (also ...
0
votes
1answer
46 views

GROUP BY Returning Different Totals [on hold]

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
25 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
26 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
117 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?
1
vote
2answers
41 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
59 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
230 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
34 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 ...
0
votes
2answers
25 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
39 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
26 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
25 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
31 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
52 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
27 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
30 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
43 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 ...
-1
votes
1answer
17 views

PDO over network, hangs MySql Database after running 1 to 3 hours? [on hold]

I have the following class --------------------------------------------- CRUD Code Snippet-------------------- class CRUD{ function __construct(){ $this->db_user = "user_name"; ...
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
22 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
13 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
77 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
21 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 ...