MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
46 views

Why MySQL taking 150% CPU?

select * from information_schema.GLOBAL_STATUS; (All other values was zero) ABORTED_CLIENTS 97 ABORTED_CONNECTS 929 BINLOG_CACHE_DISK_USE 388 BINLOG_CACHE_USE 1533317 BINLOG_STMT_CACHE_USE ...
0
votes
2answers
45 views

How to resolve: Specified key was too long; max key length is 767 bytes [duplicate]

Our server is creating a lot of tables and one of them is the Lock_ table. We are using MySQL 5.5 on Percona. Also we are using utf8_general_ci and utf8. It throws the following error when creating ...
2
votes
1answer
26 views

MySqlDump's DISABLE KEYS have no effect on import

I have a follow up to my previous question regarding import speed with Inno-Tables (suprise!). Scenario I try to import some big* database dump on my local dev machine in reasonable time. We have a ...
0
votes
0answers
27 views

How to redirect a SQL command Output in shell script?

I want to run a shell script for some group of mysql commands and the result of those commands should be saved in separate o/p file. The o/p file should contains both the query and its result. ...
-1
votes
1answer
44 views

Very Slow MySql Stored Procedure

I'm working with a web app running on MySQL. It uses stored procedures for all database-related tasks. The original web app and the database were designed by another developer; I'm only maintaining it ...
1
vote
0answers
17 views

How to calculate geographic distances using MySQL

Given a MySQL table with a series of latitude and longitude points, stored as strings, how can I find the distances between each point in the table and a given point, call it "originlat, originlon" ? ...
0
votes
1answer
16 views

how to Use old mysql database after reinstall mysql in RHEL 6?

I was getting problem in starting and login mysql server so I backuped /var/lib/mysql folder and reinstalled mysql server. Now I want to use old database files like: ibdata1 and database folder ...
0
votes
1answer
33 views

Unable to delete a record in Mysql

Let's say I have table name Company with two columns cname, location. In the table I am having two records with cname |location Asmetric |Dallas Sophore |Washington on this table when I ...
1
vote
1answer
46 views

Fastest engine for Mass Updates (only updates done on table)

I have a table of 2 columns and 60 million rows. I want to update the table by incrementing one field by 1 on various different rows (This is the only type of operation that will ever be done on the ...
0
votes
2answers
34 views

How are derived table implemented in MySQL

When MySQL makes a derived table as a result of SELECT (SELECT ...) etc or SELECT * FROM a JOIN (SELECT * from B) etc or SELECT * FROM (SELECT ...) Are these derived temporary tables created ...
0
votes
1answer
34 views

Mysql enable remote connection in centos,my.cnf does not have bind-address to comment out

I am trying to make my mysql server running on centos to allow remote database connections.I am reading this article http://xmodulo.com/2012/06/how-to-allow-remote-access-to-mysql.html that says i ...
0
votes
2answers
29 views

mysql stored procedure create date plus one day but time set to 00:00:00

In a mysql stored procedure, how can i put into a date variable:- curdate()+interval 1 day but at midnight - e.g. today is 2014-09-14 13:15:23 so the variable will hold:- 2014-09-15 00:00:00 thanks
0
votes
1answer
41 views

Mysql Select vs Select SUM performance

I need to check whether the surfer has alrady voted this can be done using Method 1 Select record_num FROM table where etc etc. i.e. SELECT record_num FROM content_votes_tmp WHERE up = 1 AND ip ...
1
vote
0answers
13 views

Conversion to Barracuda/Compressed Rows Doesn't Free Disk Space

I'm currently converting large tables to the Barracuda file format. We are using file_per_table. I had one table that decreased from 4.3gb in size down to 1.8gb and we're very happy about this. ...
0
votes
1answer
30 views

Database structure for bonus system in MySQL

I have a problem with creating the structure for my database in MySQL as I'm new in creating databases. The problem is in this: there are three tables sellers, clients and bonus. Table sellers stores ...
0
votes
0answers
21 views

MySQL database autoscaling process

Is there a tool or a method for MySQL autoscaling? If the load increases then more slaves are added and if the load decreases then the number of slaves is reduced.
1
vote
1answer
70 views

How to improve this product rental schema?

I have a rental system where each product's stock item can be rented from a location and returned to a different location (think Alamo, Hertz etc.). When saving an order, first an inventory event is ...
2
votes
0answers
28 views

longitude lattitude performance

I have to store frequently (at least every min) the position (longitude, latitude) of animals in a DB, and perform for each update a search in order to determinate if ananother animal is near to it. ...
0
votes
0answers
26 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) ...
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 ...
1
vote
1answer
56 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?
1
vote
1answer
106 views

Peer Review of Database Design

I'm working on a movie inventory database. This is a personal side project for me. I can use what I have, but I would like to make it the best design that I can while learning more about databases and ...
-1
votes
0answers
20 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 ...
1
vote
1answer
19 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 ...
2
votes
1answer
51 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
35 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 ...
1
vote
1answer
22 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
2answers
31 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 ...
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
0answers
39 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 ...
0
votes
2answers
38 views

Replicated timestamp column in different timezone

I have the master running Mysql 5.5.38 on Ubuntu 14.04 LTS. The timezone in the master is UTC+5:30. The slave is in AWS RDS which runs in UTC. The slave is primarily used for running for SQL queries ...
0
votes
2answers
57 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
20 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
40 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 ...
-1
votes
0answers
17 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 ...
2
votes
2answers
37 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
2answers
33 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
vote
2answers
46 views

Getting root node for a given leafs IDs

I got the following tables: +-----------------+ | PRODUCTS | +-----------------+ | #product_id | | #company_id | +-----------------+ | | +---------------------+ ...
0
votes
0answers
44 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
0answers
16 views

Joining 2 big tables turn into a server down problem

Recently I was using a database (MySQL with Workbench) in the company that I work for (I'm a business analyst, not a DBA), and wrongly I created a query joining 2 tables that basically are the same. ...
0
votes
0answers
21 views

How many Slaves Can I to replicate with one Master Server with MySQL?

How many Slaves Can I to replicate with one Master Server with MySQL?, because I have a inconvenient, I have three servers that replicate a MySQL database. I've maked all the configurations and the ...
-2
votes
0answers
18 views

Mysql slave autoscaling server automatically

Is There any way of Autoscaling of Mysql slave server.if load increase then more slave added and if load decrease reduce mysql server
0
votes
0answers
17 views

select value between particular date and time schedule

I have database "raj" with table "pagination" In table pagination have "id", "actualtime" and "created" field id - auto_increment actualtime- varchar created- datetime that looks like this CREATE ...
-1
votes
2answers
54 views

query to select data between todays date as well as tomorrows date time upto specific time

I have database "raj" with table "pagination" In table pagination have "id", "actualtime" and "created" field id - auto_increment name- varchar created- datetime I want to display all rows which is ...
0
votes
1answer
33 views

Slow response from SELECT query

I have 50 lac rows (i.e. 5 million rows) in student table. I fire select * from student where s_name like('%something word%') limit 0,5. I define indexing on s_name column. That query takes 2 ...
0
votes
1answer
36 views

Add database to existing replication which uses binlog_do_db?

We have two MySQL 5.5 servers running on Ubuntu 12.04. We are successfully replicating 3 databases from server01 to server02, but need to add a 4th (new) database. Our my.cnf on the master has: ...
0
votes
2answers
29 views

How to rewrite subquery to return only 1 row

I need to somehow check if query result is NULL, MySQL returns error Subquery returns more than 1 row. How should I rewrite it in order to work correctly please? SELECT DISTINCT user.id, ...
2
votes
2answers
230 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 ...