MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
6 views

replication error Error Duplicate entry… for unique key

I have two database that one of them is replicated of another one,my tables have unique key on some column ( NOT primary key ),so if in replication process an Error Duplicate entry..... occur,these ...
0
votes
1answer
35 views

Pivot table with MySQL

I'm trying to create a pivot table like output (cross table? Not entirely sure about the difference). The idea is to have rows, columns and summary values (specifically: distinct count). The data ...
1
vote
0answers
26 views

MySQL CPU & Memory Spikes

Every couple of days, my server's CPU and memory usage spikes up to 100%, making our vBulletin forum almost unusable for 5-10 minutes. CPU is typically at 1-2, Memory at 3GB. During the spikes, CPU ...
3
votes
1answer
50 views

Row size error with MySQL

I'm running a MySQL server on my Macbook (for testing). Version is 5.6.20 from Homebrew. I started running into "Row size too large" errors, and I've been able to reduce it down to this test case. ...
-1
votes
2answers
21 views

How to convert time to minutes in Mysql

I want to change the time to minutes and update the table and insert the value in the field minutes Id time minutes 1 01:00 ? 2 00:44 ? 3 01:13 ? ...
0
votes
2answers
34 views

How to store user's language knowledge (150+ languages) in mysql DB

Users in my website must be able to select languages they know (English, German, etc), so I have a table languages with 150 languages (id, name) and table users (id and a lot of other fields). ...
0
votes
0answers
29 views

Slow mysql UPDATE with IF() conditions

not sure why I can't even EXPLAIN this query. Mysql refuses to EXPLAIN it. Table contains a million meaningless test entries. Full schema and data dump of the table available here: ...
2
votes
1answer
31 views

Is data warehouse monitoring same as database monitoring?

I have a requirement, where data warehouse population is to be monitored. I am in confusion, and needed a clear picture. Is data warehouse different than database? eg. For monitoring database we ...
0
votes
0answers
11 views

Optimal Database Configuration

We have developed a Multilingual website based on Drupal platform. I want to know the optimal configuration for MYSQL database (an possibly server hardware) if we were to expect 50,000 hits per hour ...
1
vote
0answers
17 views

Mysql syntax error when i add on completion preserve

I have written this event in mysql DELIMITER $$ CREATE EVENT le_drop_database ON SCHEDULE EVERY 1 WEEK ON COMPLETION PRESERVE STARTS CURRENT_DATE + INTERVAL 4 - ...
1
vote
1answer
10 views

Import multiple CSV fields into one MySQL field

I'm trying to import our CSV data log into our MySQL. The first two fields of the CSV are Date and Time, and I would like to combine that into one date time (which can be searched) onto MySQL. CSV: ...
1
vote
3answers
113 views

Can I use PHP function strtotime() in SQL queries?

I have this table, and I need to use a PHP function in the query. id time lastTime 1 08:02 2 08:04 3 08:30 I am using this query with the strtotime(), and it's not working: ...
0
votes
1answer
33 views

Translating MySQL query to PostgreSQL

I have a query which works fine in MySQL, however when I try to recreate the same query in PostgreSQL (same DB structure) I just get a syntax error. MySQL: SELECT ticket.queue_id, queue.name, ...
0
votes
0answers
26 views

What is the difference between Row and Table Expressions in MySQL

Can anybody explain with example what is a Row and Table expression and what is the difference between them. Any example for clarification will be appreciated.
0
votes
1answer
52 views

Is normalization advisable on transactional data?

I have read a lot of articles about normalized vs denormalized schemas, but I find very little mention of the cost of row insertion. I am considering the impact of converting a 100% denormalized ...
0
votes
1answer
37 views

JOIN on 3 tables being slow

everyone. Can't figure out what indices are missing or how to rephrase my query. I created about a milllion of test entries in each table to see performance. Query takes about 1.5 seconds which is ...
1
vote
1answer
25 views

Adding time to an event that runs on a weekly basis

I have this event that runs every Thursday CREATE EVENT le_drop_database ON SCHEDULE EVERY 1 WEEK STARTS CURRENT_DATE + INTERVAL 3 - WEEKDAY(CURRENT_DATE) DAY DO BEGIN drop database carbon; ...
0
votes
0answers
9 views

RAID configuration for mysql

I attached 4 10G disks to mysql Server and I used RAID 0 but still same mysql performance the same, Do I have to change configuration in my.cnf to let mysql know about RAID 0
1
vote
2answers
117 views

RAID configuration for mysql

I attached 4 10G disks to mysql Server and I used RAID 0 but still same mysql performance the same, Do I have to change configuration in my.cnf to let mysql know about RAID 0. this is my mount ...
0
votes
1answer
38 views

What's faster: two UPDATEs with WHERE (in / not in) or one UPDATE with CASE?

What's best performance wise, two separate UPDATEs: UPDATE table1 SET enabled = 0 WHERE code NOT IN ( SELECT id FROM table2 ); UPDATE table1 SET enabled = 1 WHERE ...
0
votes
0answers
10 views

MySQL - Moving binary logs to Network Server On Windows

Is it possible to move the Binary logs for MySQL (on Windows), to a different physical server? My MySQL Databases are MySQL 5.5. (Bearing in mind that ultimately this will be a Master DB, and there ...
1
vote
1answer
22 views

Table is dropped but ibd file still exists

I was dropping some unwanted tables I have in the MySQL. When I run a drop table, its showing table doesnot exists. But when a check in the data directory, the .ibd file exists and its almost 1GB. How ...
0
votes
2answers
26 views

Rank variable value in MySQL is always being set to null

In a sample procedure I am trying to find the rank the of the cities according to the number of offices. I have a Location Table and an Office Table and a location can have multiple offices ...
1
vote
1answer
34 views

Should I drop this column or is there a query that can achieve a results table without duplicate columns?

I use a column named active in several of my database tables to adjust whether a particular entry/row/user/etc should be included in future query result tables instead of deleting the information. ...
0
votes
0answers
10 views

long mysql insert and update script user variables appear to be lost while running script

I have a mysql database table called 'dash_something' dash_something ------------- date, DATE *this is the date of the summary type, CHAR(10) entity, CHAR(25) number_of_emails_1, INT ...
0
votes
1answer
35 views

MySQL JDBC does not behaves as the MySQL Workbench

I'm running the following from the MySQL Workbench, and from my local tomcat using jdbc. START TRANSACTION; CREATE SCHEMA IF NOT EXISTS `ROOT`; CREATE TABLE IF NOT EXISTS `ROOT`.`all_tables` ( ...
1
vote
0answers
34 views

Many small queries or one single query

This is not exactly a question, more of a survey. Here at BlackBean we have a time series aggregation and analysis platform built on top of MySQL, where each client have your own database, and each ...
1
vote
1answer
24 views

Indexing the difference between two columns in MySQL

Is there a way to optimize/index a query that sorts the difference between two columns. I have a modest sized table of 5 million rows that I'm trying to do the following: SELECT pk_column, column_x, ...
0
votes
3answers
39 views

PostgreSQL equivalent of MySQL query variables?

Is there a straightforward way to adapt these types of MySQL queries to PostgreSQL: setting variables in MySQL like set @aintconst = -333 set @arealconst = -9.999 It seems not. Assigning ...
0
votes
1answer
59 views

queries for hierarchical data

This table is a questions and answers CMS and i want to know how data is fetched from these tables. +------+----------+-------+ | id | parentid | type | +------+----------+-------+ | 1 | 0 ...
1
vote
1answer
39 views

Adding foreign keys constraint on databases used

We have a server with about 20 databases, all duplicates of the same original db, and we just noticed the original is missing all the foreign keys constraint for some unknown reason. So of course all ...
8
votes
2answers
183 views

Why are simple SELECTs on InnoDB 100x slower than on MyISAM?

I have quite an annoying problem. I want to use INNODB as my main database engine and give up on MyISAM as I need the former for using galera-cluster for redundancy. I copied (description follows) ...
0
votes
1answer
64 views

Speed up a MySQL BETWEEN query

SELECT dateToFind FROM table1 INNER JOIN table2 ON dateToFind BETWEEN dateFrom AND dateTo I need to improve the performance of this kind of query. I added BTREE indexes on dateToFind, dateFrom, ...
0
votes
1answer
36 views

MySQL Replication: Seconds Behind Master super high

I've set up a slave db server for my production database, but when I checked the show slave status, I noticed a super big number in seconds behind master. This is the output: ...
1
vote
1answer
21 views

InnoDB deadlock with INSERT .. SELECT

I am trying to understand why a deadlock occurs when two workers in parallel are running INSERT .. SELECT queries on a table which has both 1) auto incremented primary key, 2) a unique index on ...
0
votes
0answers
28 views

Storing DB credentials in an application source code?

I am making an app which connects to a DB, and the app will have plenty different userslogins. Is it a good design choice to have a specific DB login/password for the application, using which the ...
0
votes
0answers
6 views

How to migrate a mysql server in production to Percona XtraDB Cluster

I need some help : I have a mysql server in production and i want to migrate all the database to an existing cluster (percona xtradb). For now , my idea is : 1) Lock all tables 2) do a dump per ...
0
votes
1answer
16 views

Best Mysql Settings for my server [on hold]

I have The following server specification: RAM : 64GB CPU : 2 X 2.50GHz (total 8 cores) This server is only dedicated for mysql database with up to 30GB of data and to run complex queries that ...
0
votes
1answer
16 views

I cant figure out the error probably with the date field in this mysql stored procedure

This is my empDetails table I am trying to create a stored procedure on. mysql> describe empDetails; +---------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | ...
0
votes
0answers
42 views

Double subquery is very slow, but independently they are fine

I have this query: SELECT mac, pid, node_category.name, status, computername, user_agent, detect_date, regdate, unregdate, last_dhcp, node.notes, (SELECT ip FROM iplog WHERE iplog.mac = node.mac ...
1
vote
1answer
12 views

MySQL - reformat a column value dependant on existing value

Am needing to provide a concatenated field from a select query which is dependant on existing values. SELECT `delegate`.`FirstName` AS `First Name`, `delegate`.`LastName` AS `Last Name`, ...
0
votes
1answer
21 views

Recovering MySQL root password (XAMPP)

I posted this on StackOverflow and was told to come here. I have an XAMPP MySQL installation and want to recover the root password. I am aware that questions have asked this already, however they are ...
0
votes
0answers
16 views

MySQL master/slave replication - replicate all tables

I am doing a master/slave replication, but getting errors about my tables does not exist. Is there not a way where i can make the whole table structure replicate aswell? Thought it did on default tbh. ...
0
votes
1answer
33 views

Proposal: MySQL blob handling revision [on hold]

Why does MySQL store blobs in the direct table rather than off to the side so that if it needs to read the corresponding stuff it will read the stuff off to the side? Essentially it would create its ...
0
votes
0answers
33 views

Unresponsive MySQL database

I've setup a MySQL server on Ubuntu machine. When running a heavy query (the table has over 1M rows), the database becomes unresponsive. Upon connection it returns: Can't connect to MySQL server ...
0
votes
0answers
17 views

Optimised way to search over 2 milllion poi data in mysql

We have over 2 million poi data in our mysql db. At any time we need to find what is the nearest point based on the following formula found at this link http://sqlfiddle.com/#!2/abba1/4 select *, ( ...
0
votes
1answer
26 views

SymmetricDS not using Lookup Transform on primary key

I'm syncing records between two MySQL databases using SymmetricDS, but need to keep the primary key (fieldname = "id") fields unique. Symmetric doesn't seem to want to obey the "lookup" transform_type ...
1
vote
0answers
32 views

MySQL 5.1 High Cpu usage on CentOS 6

I am running MySQL 5.1 on a CentOS 6 server with 16G ram. I got also apache on it. MySQL is constantly using too much cpu. top - 17:40:36 up 112 days, 12:13, 1 user, load average: 1.24, 1.72, 1.82 ...
0
votes
1answer
24 views

Useful guide & FAQ for Application+SQL [on hold]

Of course when you are making your first application for fun it doesn't matter that much how you deal with things. But when you need everything to be up to the current standards you don't always know ...
0
votes
0answers
55 views

Change a query so it no longer takes 20 mins and uses a 93G tmp table

Edit: So how would I go about changing this query to something more sane (given that I can work around the hibernate madness) This might be a whole different problem, but Hiberate has created a ...