MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
29 views

Update records that match like regex from another table

I have two tables - ProductCategories and Products ProductCategories --- productid categoryid 1 2 3 4 Products -------- productid productname 1 Apple 2 ...
0
votes
0answers
16 views

UPDATE & DELETE multiple rows with an array for the id

I wan't to check for challenges a user's team posted that have not been excepted after 1 day, then autorefund the user's team back there credits, and then also delete all the challenges. So far here ...
0
votes
2answers
21 views

How do I figure out what is consuming space in my Zenoss DB (mysql)

I have been running Zenoss 4.2 and the filesystem has never exceeded 20gb. In the past 3 days it has shot up to 90gb and I am almost out of disk space. It appears the used space is all in ...
0
votes
1answer
13 views

Select Count on Big table take 15 minutes

I try to run select Count on table with like 16M rows, with MySql 5.5 and workbench 6.2. The query running almost 1000sec . Is it normal? The query : SELECT COUNT(1) FROM My_Table when I run ...
0
votes
0answers
14 views

ERROR 2013 (HY000) When long string data managed

This is my first question on this community, I'll explain the situation: I have a server with PHP and Mysql on it, on that server I have a wordpress blog. Lately i've been receiving a lot of spam ...
0
votes
1answer
28 views

Large long-running reporting queries are causing very slow new mysql connections

Usually, mysql's connecton time is in the 0.001 second range. However, when I run a large reporting query (that spans multiple tables with aggregates), I get tons of warnings saying that new mysql ...
0
votes
0answers
7 views

Points/Scores display from and to the Database in Android app

I am an absolute beginner to the Android programming and I am trying to develop an Android application using Eclipse where user is able to login/register and is able to see his "white" points based on ...
0
votes
0answers
17 views

Building an economic time series database with aggregation/dis-aggregation capabilities

I am trying to build a database in MySQL and MS Access that contains economic indicators and financial time series. Initially, I wanted to solve the problem by setting up a table for each major ...
0
votes
0answers
22 views

Database design for price comparison site - too complex?

I'm working on a regular price comparison site with two exceptions. I want to show price history and also allow users to subscribe to a product with a specific size and color. As a result, I've ended ...
0
votes
1answer
16 views

Could not start mysql or MariaDB. Permissions were ok, but mysql-bin.index permission error

Using MariaDB 5.5.36. Here's what I got while trying to start MariaDB: # syslog Dec 14 09:40:52 vps1497 mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql Dec 14 09:40:52 vps1497 ...
1
vote
1answer
37 views

Database structure (MySQL)

I have a database called data that is going to contain some data about writers, books and images. I've created these tables so far, but I don't know how to struct the images table. A writer or book ...
1
vote
3answers
41 views

How i can export just structure of mysql database

I use ubuntu 14.10 Phpmyadmin I have ''big'' mysql database, 900mb, I need just structure of this database, how i can export just database structure/empty database without remove data or download ...
1
vote
2answers
51 views

One to many join, Sum from both table

I have two tables: orders and ordersdetail...(partial table) orders- id(primary key), amount, date( index) orderdeails- id(primary key), skunitid, quantity, order_id Each order has multiple order ...
2
votes
1answer
42 views

How to speed up slow query using GROUP BY and CASE?

I'm not very experienced with MySQL and and trying to figure out how to speed up a slow query using GROUP BY and CASE statements. CASE 1 -- GROUP BY and CASE SELECT SQL_NO_CACHE m.id, m.sku, ...
2
votes
1answer
14 views

MYSQL binary log file not capturing in slave machine

mysql binary log files are not getting captured in slave machine, its available in master machine. When i check the binary log files its of size 1kb without any data in slave.
2
votes
1answer
18 views

MySQL replication for non-standard port (3306)

I want to do MySQL replication using MySQL 5.6.14 under MS Windows 2008 R2, the port for Master and Slave should be 1000 (master database on PC1, slave database installed on PC2 I added the following ...
1
vote
1answer
17 views

How do I set the MySQL error level?

Given the following table: CREATE TABLE Test ( id int(10) unsigned NOT NULL PRIMARY KEY, value int(10) unsigned NOT NULL ) ENGINE=InnoDB; If I insert a value with only the id field set: INSERT ...
1
vote
0answers
31 views

25.000+ rows - MySQL SELECT consecutive numbers performance issue

I have tried to be as explicit as I could. Below you have the query explained in details What I want to obtain? - I want to SELECT start_number and end_number from a set of consecutive numbers from ...
1
vote
0answers
22 views

two column compare ,get count(*) of two column A value same cloumn B value

I have a Mysql table as --------------------- -- page - user -- --------------------- -- page a - user 1 -- -- page a - user 2 -- -- page a - user 3 -- -- page b - user 1 -- -- page b - user 3 -- ...
0
votes
1answer
10 views

How to get mysql automatically running when I start tomcat apache on Windows?

When starting my Tomcat Apache Server, I've been having to start up mysql before than using the mysqld command. I was wondering if there was a work around this so that I could have mysql start up when ...
1
vote
1answer
25 views

MySQL unique index only if column has specific value

I have a table where I use a boolean column deleted to signify whether a specific record has been 'deleted' by the user (meaning, it appears in the trash list instead of the normal list). These items ...
1
vote
1answer
26 views

MySQL Latest Deadlock Explanation

Can someone explain this deadlock to me? It seems as if there are 2 inserts happening within milliseconds of each other with the same Primary Key. I'm not sure how this can cause a deadlock. At most a ...
1
vote
1answer
32 views

Is there a way to run mysqldumpslow against slow queries logged to a table?

AWS RDS by default logs slow queries to a database table. Is there a way to run mysqldumpslow against that table, without exporting it to a file first? Or is there a better way to get a report of ...
0
votes
2answers
35 views

Use of IN clause within a DELETE command - MySQL

I am browsing through the official MySQL documentation to learn about the DELETE clause. This page states DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name [WHERE where_condition] [ORDER BY ...] ...
1
vote
1answer
22 views

'DROP TABLE mysql.failover_console;' replicates to slaves, but 'Use mysql; DROP TABLE failover_console;' does not

I am currently looking to setup automatic failover for my MySQL 5.6.21 Master on CentOS 6.6. I have mysqlfailover set up in my lab, and it is working well enough. My question is not about that, but ...
0
votes
1answer
19 views

SQL query to aggregate data from three tables

I have the following three tables: The "users" table: user_id first_name last_name username password The "users_addresses" table: address_id user_id street country_id email The "countries" ...
1
vote
0answers
17 views

MySQL calculate overlapping period excluding overlapping rules

I would like to calculate the period overlap in hours based on special rules. I created a test setup, that works as long as the rules themselves don't overlap. Example non overlapping rules: id ...
0
votes
0answers
22 views

I have changed table engines from MyISAM to Aria, should I change the database engine too?

I have changed all tables in my mariadb database from MyISAM to Aria (using adminer as tool), but the database engine is still shown as InnoDB. Should I change this to Aria, too? I did not choose ...
-1
votes
1answer
47 views

what is the syntax for insert trigger?

I am very new to sql. feel a little stupid to ask this question Say I have this table Warehouse(shipperid, name , state). Then I define another table warehouse_maine (shipperid, name, state) which ...
0
votes
2answers
22 views

Aggregating sum day by day from multiple joins returns unexpected results

I'm trying to make a table where the task hours and group hours are aggregated day by day. I'm able to get the wanted result for both tasks and groups, but when I try to get them in the same query, I ...
0
votes
1answer
20 views

what should be the good normalization for the following scenario?

ITS JUST FAKE TABLE DATA TO SIMPLIFY MY PROBLEM I have tables ,, Users , shirts, pants, belts .... each will have some data... so by some research i have made some scenarios of links between the ...
1
vote
1answer
24 views

Database structure setup

We're currently in the process of moving our hosting services to something which will allow us to scale our infrastructure and requirements. Essentially we're using MySQL to: Run our websites. Run ...
2
votes
0answers
23 views

How to query for additions and deletions between two sets of rows (mysql)

I have tried several variant queries for finding additions/deletions between two sets of rows. Purely algorithmically, there is a straightforward algorithm that is O(N) for composing a list of ...
0
votes
0answers
16 views

Accounting - Dimention table in mysql

I am designing a accounting and mini erp system. I use a date dimension table to track all date related data. In oracle we can have many schema for a database. so we could create each schema for ...
-2
votes
4answers
197 views

Is there a SELECT statement to subtract rows of the same column?

Column 1 is the mem_id, Column 2 is the Transaction type C and D, and Column 3 is the Amount Owed. So I want to return Column 3 "Amount Owed", but it has to be C-D in Column 2 for each member. ...
0
votes
1answer
18 views

Optimizing for Modulo Queries

I have a use case where I want to be able to query tens of thousands of records for the modulo of a certain field value with another number, i.e. queries like SELECT * FROM EVENTS WHERE MOD(OFFSET)=5 ...
0
votes
1answer
20 views

Replicate MySQL INSERT to MSSQL table

I'm running into a challenge here trying to "sync" a MySQL table with a MSSQL table. My scenario involves my linux-based website submitting form data submissions to a MySQL database on that web ...
1
vote
1answer
19 views

MySQL InnoDB restoration from hardware failure

One of my server went down due to old hardware failure on a old Dell server that's over 10 years old. I was able to recover the files and got it to a local machine. I want to restore a MySQL instance ...
5
votes
1answer
205 views

SELECT INTO OUTFILE vs INSERT INTO … SELECT

During my cursory research I have not been able to find a definitive answer on the benefits that SELECT INTO OUTFILE provides over INSERT INTO ... SELECT. Upon reading the docs related to INSERT INTO ...
1
vote
2answers
48 views

How to get the sum with more then one table

I have 3 tables as shown in the link sqlfiddle When I take the sum with two tables I get good result sqlfiddle but when I add 3rd table and it's query I get unexpected result as this ...
0
votes
1answer
41 views

SQL INSERT and UPDATE queries run far to slow

I have two queries that run far too slow and I have no idea why. Both tables contain about 500000 rows. Each call needs ~20 minutes and the they have a really high CPU usage (~90% on Mac). I have ...
0
votes
1answer
27 views

MySQL output file location - accessing server files

I am running the MySQL Workbench 6.2 CE on Windows7. I have an output table of 200,000 rows and I need to save it. I will have to repeat this task, so I would like to iterate the following code: ...
0
votes
1answer
21 views

create multi valued variable inside mysql stored procedure

I have two IN variables into my MYSQL stored procedure. I pass one into a select statement and the value is taken in a temporary variable which is passed to the second SQL statement. CREATE PROCEDURE ...
1
vote
1answer
39 views

What MySQL data types REQUIRE a max length (size) declaration in a create table statement?

I am converting a SQL Server table structure to a MySQL table structure, and I need to know how to properly declare the column data types within the CREATE TABLE statement. I have a CSV file where ...
1
vote
1answer
51 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
12 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
1answer
18 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
32 views

Migrating Data to A New Database Schema [closed]

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
18 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 ...