MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
182 views

How to organize the tables of a MySQL database with several statistics data of several years?

I am developing an app that must provide statistics information about the distribution of the money that a person spends each year in taxes in the city where he lives. The user should select the ...
0
votes
0answers
12 views

Control Query Time

I have a table for comments and I want users to wait 5 minutes before sending other comments. I have five columns: id, id_user_to, id_user_from, message and ,date (this is a table for comments). I ...
0
votes
1answer
107 views

Get child record from specific root

I have two tables articles and topics and I am using MySQL 5.6 Articles id topic(fk on Topics.id) featured 1 1 1 2 2 0 3 3 ...
0
votes
0answers
24 views

Best practice for storing image order number in a database

I am designing a social networking website(mysql with InnoDB engine + php) where I need to store image sequence in a database. The table structure is as follows:- PicId (BIGINT, AUTO INCREMENT, PK) ...
1
vote
1answer
53 views

MySQL - varchar length and performance

Is declaring VARCHAR size make sense for performance? Is there any difference (in speed) between VARCHAR(50) and VARCHAR(255)? Or defining length is logic/design constraint?
0
votes
1answer
2k views

MySQL count multiple columns and sum the total occurrence

I have the following table, say, MyDRAW ... DRAWNO PRIZENO FIRSTD SECONDD THIRDD FOURTHD M123/14 8458 8 4 5 8 M123/14 7214 7 2 1 4 M123/14 1640 1 6 4 0 ...
1
vote
2answers
118 views

How to make a better Data model

I am creating a database system using MySQL for a group in my school (a University). I am new to MySQL and its usage.I have started with the data modelling process, since this process will be the main ...
-2
votes
0answers
17 views

Performance suggestion tool for MySQL in windows? [closed]

Is there any free tools for Windows which make suggestions on how to improve the MySQL database?
0
votes
1answer
419 views

Are there any disadvantages to partitioning on financial year?

Our current set up has one table per financial year (May 1- April 30). Each table has approx 1.5 million rows. We have about 8 years of data, and will obviously be adding each year. The majority of ...
1
vote
1answer
55 views

Cannot create foreign key on 2 VARCHAR(45) columns in MySQL Workbench 6.1

I'm trying to create a foreign key. The columns in both tables are VARCHAR(45) and neither is a PK, however I keep getting this error message: It is saying the PK of reference table is INT, which ...
1
vote
1answer
18 views

MySQL Junction Table as Foreign Key?

I have several tables: company, customer, company_has_customer, and transaction. company_has_customer is a many-to-many junction table using the PKs of company and customer as its PK. In almost all ...
0
votes
4answers
162 views

Amazon: How to change database name in Amazon RDS MySQL?

I want to change MYSQL database name of the DB instance of Amazon RDS. How it can be possible?
0
votes
1answer
49 views

Quickly etablishing if a remote MySQL connection is valid using PHP

I have a hosted website (Namecheap Pro shared hosting) that connects to a remote MySQL database using a read-only user privilege. This remote DB is updated by a separate system. The website works ...
-1
votes
0answers
17 views

Slow Performance with Multi-threaded app - MySQL InnoDB

My application is a java 1.7, multi-threaded application with MySQL 5.6 as the backend. Application reads data from files and writes it to corresponding tables in multithreaded fashion. The ...
0
votes
1answer
1k views

Optimize IN clause in where query with order by - MySQL

I am trying to optimize a query that using IN clause in WHERE to avoid file sorting. To make it easy , I created the following sample which shows the problem. Here is my query: SELECT * FROM `test` ...
2
votes
1answer
48 views

Running a query on an improperly indexed, 600gb table

This is my first post on here and I'm really baffled by this. I have joined a team and somewhere in the past a horrific table was created which has been bloated to a point of 600+gb of data. ...
0
votes
1answer
31 views

MySQL Entity Relationship Problem - 3-way join table?

This is a db relationship question. I have a scenario which I believe I have come up with a solution - however, I can't be sure it's a manageable one, or even correct. The scenario is as follows: ...
0
votes
1answer
64 views

Using non-replicated read/write databases on a MySQL slave server

I have a MySQL slave server that has two databases being replicated from a master. What I'd like to do is add a third database that I will exclude from replication and use as a read/write database. ...
0
votes
2answers
311 views

Is there a way to enable MariaDB MEMORY storage engine for every table?

I am new to MariaDB and interested in using it because I want to use MEMORY storage engine for every table. I read MEMORY storage engine on mariadb.com and it seems like I had to specify storage ...
0
votes
1answer
134 views

AES 256 data encryption on Mysql

Is there a way to encrypt the whole data of a mysql DB using the AES 256 symmetric encryption method without encrypting the data manually using AES_ENCRYPT ? This article explains about the same ...
1
vote
1answer
20 views

pt-query-digest results are empty

I have a slow log generated by MySQL 5.1.71-log, that I've copied onto another machine. It appears I'm not getting any results from pt-query-digest. $> pt-query-digest slow.log # 2.1s user time, ...
0
votes
1answer
104 views

Duplicate Relationships in Rails/MySQL Healthcare Application

Overview of the Application I am building a Ruby on Rails application to organize medications, using MySQL. The goal of this application is to provide dosage specific treatment recommendations, and ...
0
votes
1answer
32 views

Efficient way to DELETE whole partition's data in table partitioned by HASH(DAY(datetime))?

I have a MySQL InnoDB table PARTITIONed by HASH(DAY(dateTime)). I'd like to remove partitions holding data older than 10 days. CREATE TABLE `partitioned` ( `id` bigint(20) unsigned NOT NULL ...
0
votes
1answer
55 views

Percona cluster + Wordpress blogs, low performance

We currently run ~ 900 WordPress blogs on several machines so was decided to move to load balanced environment with clustered db. I followed instructions from ...
0
votes
2answers
24 views

How do I fix #1062 error received while importing EE database to localhost from remote server

I am trying to import a MySQL database into the localhost database that was exported from the remote database and I am receiving a #1062 error (which is weirdly in French!): #1062 - Duplicata du ...
7
votes
8answers
7k views

What tools are there for data masking? (MySQL, Linux)

I'm looking for (ideally free, open-source) data masking tools. Do any such exist? Note: this related question deals with tools for generating test data, but in this question I'm more interested in ...
2
votes
2answers
223 views

Get table name from union query?

This is my query SELECT Id, productName, Largeimagepath, Discount, Price, Image FROM tablename1 where Active =1 union SELECT Id, productName, Largeimagepath, Discount, Price, Image FROM tablename2 ...
0
votes
2answers
55 views

Is it possible to copy a dev. database schema over a prod. one, but keep the prod. database' data?

I'm using MySQL 5.6. I have a production database and a development database. As I'm developing the application, I sometimes need to add new columns/tables to the database. Is it possible, when I'm ...
0
votes
1answer
27 views

column value is not increment after 10

I tried below 2 codes.... showing same error 1.SELECT columnname FROM tablename ORDER BY columnname DESC LIMIT 1 SELECT MAX(columnname ) AS max FROM tablename I am trying to increment value of ...
0
votes
1answer
21 views

Fetch data from database from multiple tables matching condition

I want to fetch data from the database. I have three tables in my database like listing_master_residential and listing_master_condo and listing_master_commercial. There are three tables and there is ...
0
votes
1answer
118 views

mongodb equivlant query to this sql group by

I have a collection where most documents have an ISODate column. I'm wanting to get a basic count by date for that column. In MySQL if I had a datetime column on a table, to get what I'd want I'd do ...
1
vote
1answer
946 views

MySQL SELECT query hangs - Opening Tables INNODB

On my server I have 6 MySQL databases. They all power Wordpress websites. For some reason, 2 of these databases are not accessible. To my knowledge they use INNODB, but I can't confirm it as even ...
0
votes
0answers
34 views

Communications link error with MySQL

I have a process which runs via Pentaho on a Unix server against MySQL 5.6.19. and using 5.1.32 of the MySQL jdbc driver. We actually found this driver helped with this error in some cases compared ...
1
vote
1answer
71 views

Query does not use index (according to EXPLAIN SELECT)

Can anyone give me an indication, why this query does not use the Key on the table 'gtg'): ...
0
votes
1answer
52 views

Restore InnoDB from .frm files

My database crashed and my PC and I now only have the .frm and .ibd files left. Is there any way to restore my database?
0
votes
1answer
754 views

How can I get Performance Statistics to work in MySQL Workbench?

I have a complex query that is performing in subsecond time on my laptop, while the same query takes 70 seconds on my production server under no load against an identical schema. The EXPLAIN plan is ...
0
votes
2answers
222 views

Experience with Scalearc sharding?

Does anyone have experience with Scalearc sharding and it's ability to scale ? Does Scalearc needs to have the whole data in memory or does it behave well with disk storage ? I'm thinking to big ...
0
votes
1answer
157 views

facebook group alike database scheme

Here are my requirements: one user can have many tasks one group can have many task one group can have many users only invited user by a user can be added into a group Does this db design appear ...
0
votes
3answers
1k views

Deleting Data From Multiple Tables

Suppose,I've a table called UNIVERSITY containing universities name: universityID universityNAME isACTIVE 7 GNDU 1 6 PU 1 5 ...
0
votes
1answer
19 views

Action_id group by for last 3 days in 3 different colums

My requirement is as below. I have a table like this. ----------------------------------- REQUEST | DATE | ACTION ----------------------------------- 1 |15-SEPT-2014 | ACT1 ...
1
vote
0answers
39 views

Indexed query fails to return rows in large (15 billion rows) MyISAM (MySQL) table

I have a very large table (15 billion rows) with a structure like this: CREATE TABLE `textlines` ( `PGUID` binary(16) DEFAULT NULL, `StatID` int(11) DEFAULT NULL, `Time` datetime(3) DEFAULT ...
0
votes
3answers
108 views

Large RAM use after import database - ubuntu server

My new VPS has 4GB of RAM. Before importing database system use about 1.2 GB of RAM. When I import into the database, using 250 MB SQL file, 25000 tables use of RAM goes to 97%, htop showing 3302 mb ...
0
votes
2answers
30 views

MySQL: How to fetch nth level child menus of a parent menu

I have a menu which is parent of multiple menu items and each child menu has their own child menus. This pattern is continued till 5-6 vertical hierarchy level. I don't want to write a query which ...
-1
votes
0answers
16 views

Sync MYSQL to MSSQL

I have 2 applications and one uses MSSQL and the other uses MYSQL. I am trying to copy columns from one table in mysql to a column in mssql table. On mysql database i have a table called Contracts ...
1
vote
2answers
45 views

Getting root node for a given leafs IDs

I got the following tables: +-----------------+ | PRODUCTS | +-----------------+ | #product_id | | #company_id | +-----------------+ | | +---------------------+ ...
1
vote
1answer
68 views

Reviewing relational database tables

I am building a database, but I am a little bit confused with my table relationships. I wish someone could help review my table relationships below for me and tell me where I am going wrong. I have ...
2
votes
1answer
32 views

Should we enable innodb_file_per_table for single tenant SaaS app (thousands of databases)

We have a mySQL backed SaaS application where each customer has their own mySQL database. So think of it like a wordpress/magento etc. database for each client. Each database has ~200 table, and we ...
0
votes
0answers
43 views

Why is MySQL database is having irregular performance issues?

I first thought it was because of some bad queries, but it wasnt. It took 90 secs to execute a select statement on a table with two rows one column while during other times it executed within ms. ...
0
votes
2answers
151 views

mysql need help optimizing query

I have a table containing servers logs, and another table containing rules to match certain and drop them. The logs tables contains around 1 million rows, and there are about 20-30 rules. The ...
0
votes
1answer
587 views

Problems in opening mysql query browser

My mysql query browser doesn't run. I just started to work with xampp and php. So I just installed xampp in my local machine. Now I have a problem in opening mysql query browser... What I'm getting ...