MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

3
votes
0answers
17 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
0answers
11 views

MySQL replication: Seconds behind Master super high

I've set up an 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: ...
0
votes
1answer
65 views

What is the strategy of query evaluation in DBMS when Limit is used in query?

I have following tables in database post(post_id , user_id , post_text , parsed_text) ; Comment(comment_id , post_id , user_id , comment_text) ; friend(id , user_id , friend_id ) ; group (id , ...
0
votes
0answers
11 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
181 views

MySQL DB structure with Main category and several nested sub categories

I am looking to create a set of fields on my webpage identical to what eBay uses on their category selection page when you are selling something. For my purposes I am doing motorcycles, power sports, ...
1
vote
0answers
5 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
11 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
1answer
52 views

GROUP BY performance

I have a query like this: SELECT HOUR(datetime) as Hour, COUNT(*) as hits, SUM(clicks) FROM visitors_log_table WHERE datetime >= CURDATE() GROUP BY Hour WITH ROLLUP It works fine. But I ...
0
votes
1answer
13 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
3 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
2answers
4 views

SQL Select a rolling count of total transactions over time

I need to get a set of total transactions over time on a weekly interval. Essentially I need a total-transactions-to-date column. When I group by WEEK(Date) I get the amount of transactions for that ...
0
votes
1answer
17 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
1answer
10 views

Best Mysql Settings for my server

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
0answers
49 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 ...
1
vote
1answer
7 views

Not able to update MySQL table using Oracle: Unknown column in 'where clause' {42S22,NativeErr = 1054}

I have the following tables: MySQL table: jti_member_interact CREATE TABLE `jti_member_interact` ( `INT_MEMBER_ID` int(11) NOT NULL, `INT_ID` int(11) NOT NULL AUTO_INCREMENT, `INT_SOURCE` ...
1
vote
1answer
1k views

statistics State in MySQL Processlist

I have a busy MySQL Server having query SELECT sys_sess_state, index_state, timeout_lvl, last_queued_dt, last_polled_wait_dt, create_id, create_dt, modify_id, modify_dt FROM PQR_AM_SYSTEM_SESSION ...
0
votes
1answer
32 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
1answer
45 views

How to prevent crashes connected with dropped tables during mysql import?

I have made a mysql dump with mysqldump, tables are dropped and re-created with DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( However for a read-intensive database I sometimes get crashes ...
0
votes
2answers
2k views

In place upgrade from MySQL 5.5 to 5.6.11 removes all users from user table

On Windows, I upgraded from 5.1 to 5.5 no problem. Copied my 5.1 data folder into my 5.5 instance Started mysqld skipping grants Ran mysql_upgrade All good, but going from 5.5 to 5.6: Copied ...
0
votes
2answers
91 views

MySQL incremental backups per database (not global)

While searching for free/open-source MySQL incremental backups solutions I have found a number of ways to do incremental backups and all of them seem to either rely on "logical" way of backups/restore ...
1
vote
1answer
256 views

How to rebuild entire MySQL data after server re install?

I have a MySQL server running with multiple databases in a 32 bit environment. I need to rebuild my system to a 64 bit environment. Is it possible to replicate the entire MySQL databases, users, ...
2
votes
1answer
94 views

poor and/or unreliable InnoDB performance

I recognize that there are a ton of posts like this, but after reading up on InnoDB performance problems, nothing I tried has helped. I have a database containing four InnoDB tables. The largest ...
0
votes
0answers
30 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
11 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`, ...
2
votes
1answer
190 views

MySQL Queries take up to 35 seconds

My site is very slow sometimes, so I activated the php-slowlog to find out whats wrong. It is full of mysql-functions like mysql_query. So I activated the mysql-slowlog and found out that some querys ...
0
votes
1answer
39 views

Multi-Column Full Text Search Going Very Slow

I have a full text index on a table articles for the columns content, title and keywords When doing the search on each of the columns, like so select count(1) from articles where ...
0
votes
0answers
15 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
45 views

Replication in mysql with many servers

There are 3 shops. In each of these is a mysql server. I want all servers to synchronize their date if at least one server changes the date. I read a bit of literature and realized that I need ...
0
votes
1answer
22 views

Useful guide & FAQ for Application+SQL

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
13 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 ...
0
votes
0answers
29 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
13 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 *, ( ...
2
votes
2answers
195 views

“All joins can be rewritten to sub queries”, is this statement true?

I wonder if there any case that a join can not be converted to a sub-query. BTW: I am not discussing advantages and disadvantage of using sub-query or using join.
1
vote
0answers
20 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
2answers
101 views

Getting a Deadlock,

I have this code : public void saveItems(List<Pair<Item, MapleInventoryType>> items, int id) throws SQLException { PreparedStatement ps = null; PreparedStatement pse = null; ...
0
votes
2answers
335 views

Why does this procedure raise a privilege error?

I am having trouble getting the following procedure to run on a remote MySQL database - the given error is privilege based (#1227). Locally, the procedure runs fine. QUESTIONS Could somebody help ...
2
votes
1answer
20 views

Innodb DB Consuming IO even when no operations are being done

I am currently doing some stress testing where I am pushing inserts to the database as fast as I can. The simulation inserts 10000 records per second. After inserting around 200 million records I ...
0
votes
1answer
257 views

INSERT take too much time

I have in my MySQL DB a few tables Most of the time, I'm only doing INSERT in my db. I have up to 4 connections to the DB, each one inserting into a different table. There cannot be two connections ...
0
votes
1answer
89 views

(My)SQL: management and duplication of multiple sub-databases

I have a pretty simple question, but it seems that there are controversies as to how to solve it in the best possible way. Say I have a web app that makes online surveys. My challenge is that each of ...
0
votes
1answer
49 views

Can a primary key of one table be a foreign key of another table?

I am working on a scenario like this : I have an employee table which has columns like this Employee_ID First_Name Last_Name Employee_Designation Also I have a Joining_Vital table Employee_ID ...
4
votes
2answers
69 views

ON DUPLICATE KEY UPDATE faster than UPDATE

I have a table with about 17 million rows: mysql> describe humans_we_respect; ...
3
votes
2answers
228 views

mysql second slave not syncing while first slave works fine

I have a master (m) - slave (s1) setup using mysql 5.1.45 When I try to add a second slave (s2) the slave lags behind and never catches up on the sync. Even after having synced the s2 with the whole ...
0
votes
1answer
926 views

How can I set a default session sql_mode for a given user?

I want to have a default session sql_mode that is different from the global sql_mode. I can set it manually, but I'd like to do it automatically. I thought I could add it to .my.cnf, but that ...
1
vote
2answers
266 views

Import CSV file into Mysql with Multiple Delimiters/Field Separators

I'm trying to import a large csv file into Mysql. Unfortunately, the data within the file is separated both by spaces and tabs. As a result, whenever I load the data into my table, I end up with ...
0
votes
2answers
35 views

Retrieving row ranking in a table

I'm aware there are already many questions alike however none of those answers helped me achieve row rankings in a table. I have a table set up as so: ...
0
votes
2answers
501 views

How to determine the optimal sort_buffer_size?

I read from a sample configuration file which says the following: # Sort buffer is used to perform sorts for some ORDER BY and GROUP BY # queries. If sorted data does not fit into the sort buffer, a ...
1
vote
1answer
35 views

How to change rows to columns in mysql?

I have data as following(it is just an sample, I have 100+ different types.): advertiser_id activity_type counts 1 1 2 1 2 5 2 1 ...
0
votes
2answers
76 views

Anyway to optimize complex view?

In the system, Files can belong to either products, clearances, business_lines or titles. Clearances are records that represent a combination of a title and a product. Products are collections of ...
0
votes
0answers
10 views

mysqldump replace option - ubuntu / mediawiki

I know this is probably a silly question, but I'd like to be sure, rather than make assumptions. There's the option to use 'replace' in a mysqldump, which uses the 'REPLACE' rather than the 'INSERT' ...
3
votes
1answer
279 views

Deadlock free MERGE-alike in MySQL?

I am trying to implement some parts of MERGE in the MySQL driver in Drupal. Of course, Drupal has something but in truth it only works because the most frequent MERGE issuer just eats exceptions. So, ...