MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
0answers
13 views

select on table slows done during update on same table

I have a weird problem with mysql. During a transaction which runs from 10-30s around 270 statements are performed, some of which are updating and inserting a few rows on a table. If a select is ...
0
votes
0answers
9 views

Data load architecture advice?

imagine you have several isolated mysql database servers each responsible for capturing their local data, and you want to upload diffs of data (could be any DML) to a central server which holds ...
3
votes
1answer
238 views

One foreign key for two columns

I have two tables, Results and Teams Teams has the following columns: team_id team_name Results has the following columns: match_id home_team (foreign key references teams [team_id]) away_team ...
-5
votes
1answer
33 views

i want to create one generic query for all database like Oracle,Mysql,Mssql

I have to create different query for different database like Oracle,Mysql,Mssql .but i want to create only one generic query which runs or should works on all different database like ...
2
votes
1answer
23 views

MySQL: Sum if rows are equal

I have a table with 4 columns: Client , thickness , material and amount. I want to make a SQL select-query to select everything, but when the client, thickness and material are the same their value ...
1
vote
1answer
26 views

How can I speed up an sql query that round trips between two tables

I first posted this question on stackoverflow, and now I see this site, seems more relevant. These tables are not that big, but the time taken to process this query is long. What can I do with the ...
0
votes
0answers
21 views

MySQL Multi Count and Filter

Table: Event ============== ID OldUserID NewUserID Date Table: User ============== ID Forename Lastname .... How can i filter by date column like so... this code is pseudo... SELECT ...
1
vote
1answer
13 views

is it possible to get innobackupex to print the filenames it's busy with?

I am getting crashes when trying to run innobackupex --apply-log. How can I find out what files it's processing at the time? I don't see a relevant option mentioned in the documentation.
0
votes
1answer
14 views

Creating Triggers to insert into a table where the table is altered by other application

I have a database in my local machine which is actually updated by an online application. I want to create triggers for a particular table ( say table1) such that it inserts values (From Table1) ...
0
votes
1answer
14 views

insert multiple authors only if it exists in MySQL

I have a problem . I am doing a PHP -My SQL project . I got to store author/s of a conference paper in a database . But sometimes its just 1 and sometimes it can be 2 or 3 or 10 . So how do i store ...
0
votes
0answers
5 views

Question on turning on GTID for MySQL master and slaves

I came across the interesting article by Facebook's Engineering team where they were able to deploy GTID in MySQL at a large scale : ...
0
votes
1answer
8 views

Query Performance Regression Between Different Versions

I have two MySQL databases, A and B. They have identical hardware and schema. They have different data and database A has more data then B. Database A is also running version 5.1, while B is on 5.5. ...
-1
votes
2answers
36 views

MySQL Multi Count

How can i get this result? ╔═════════╦═══════╦═══════╗ ║ EventID ║ User1 ║ User2 ║ ╠═════════╬═══════╬═══════╣ ║ 1 ║ 1 ║ 2 ║ ║ 2 ║ 2 ║ 3 ║ ║ 3 ║ 3 ║ 1 ║ ...
0
votes
1answer
12 views

MySQL - Backup new and modified entries only

I am developing a very huge system in Java using Hibernate and MySQL. Now, I want to automate the daily, weekly, and/or monthly replication (backing up) of the data that are stored from the database ...
0
votes
0answers
6 views

Simple way to migrate application SQL database into an archive database?

I'm not super technically oriented. I've used SQL for many years, but primarily operating within databases and not so much managing them in total. Anyway, we have an application we're getting rid of, ...
0
votes
0answers
16 views

MySQL what is the order of the table lock for this query?

An example query looks like this: INSERT INTO Adventure (sword, fighter, quest) SELECT Swords.id, Fighters.id, Quests.id FROM swords Swords, fighters Fighters, quests Quests WHERE Swords._id = ...
1
vote
1answer
6 views

Mysql update adding subquery field value to field

I want to update a field adding it the value of a subquery field. I'm trying this: UPDATE table a SET a.field=(a.field+b.subfield) INNER JOIN (SELECT subid, subfield FROM subtable WHERE ..... ) AS ...
0
votes
1answer
20 views

optimize my query mysql

I have the following query: SELECT DISTINCT d.movieName, d.castName, d.movieImdbId, f.year, f.posterLink FROM director_movie as d LEFT JOIN film_info as f ON d.movieImdbId = f.ImdbId WHERE d.castName ...
0
votes
1answer
30 views

How to move data from SQL Server to MySQL database

Our MSSQL database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL database and place it in a more optimized format. For some reason, the people ...
-1
votes
0answers
20 views

mysql server bigint [on hold]

I am running an error from MySQL server, where it indicate that bigint is not support by MySQL server 2008, what is the problem from my data migration when I want to execute the database?
0
votes
0answers
12 views

MySQL crashing after a couple of days: Link to database cannot be established: SQLSTATE[HY000] [2002]

MySQL is crashing on my server every couple of days (could be a bit more than one week or 4 days). The install is on a VPS that is not really used. Here is the error message I have: Link to ...
0
votes
2answers
56 views

Find the last visit by teacher and show the rest of columns in MySql

I would like to group the teachers by the last visit and show the other values corresponding to the last visit. CREATE TABLE IF NOT EXISTS `visits` ( `FIELD1` int(5) NOT NULL, `teacher` varchar(9) ...
1
vote
1answer
19 views

at least one member of a list within another list when querying over a join

assume the current layout in a Mysql datbase Activity (id,etc) [id is primary key] AcitivityMapper (activityID, targetYearID) [composite key] Years (targetYearID, targetYearName) [id primary key, ...
0
votes
1answer
11 views

Multi-master synching in three geographically separate datacentres

Our company needs to create an application that operates in all parts of the world. We are looking to have three servers (one in Europe, one in Asia and one in America). I'm looking to use ...
0
votes
1answer
22 views

Simple left outer join leaving me with inner join

So I have a table with each record being a change to an object. e.g. in the app you open your project with a project id in this project you edit an object name hit save that generates new record ...
0
votes
0answers
13 views

multi aggregated sql query functions

I have the following query: SELECT u.username, t.pack_id, COUNT( t.id ) transaction_count FROM `transaction` t INNER JOIN `user` u ON t.customer_id = u.id GROUP BY ( t.customer_id ) HAVING ...
0
votes
2answers
39 views

Performance Benchmark - MySQL vs PostgreSQL [on hold]

this is my first question here in DBA. I wish to do a performance comparison between MySQL and PostgreSQL using same database on the basis of total time taken to parse + execute + send result back ...
0
votes
1answer
23 views

MySQL insert position value

I have trouble while inserting the values corresponding to a column: position. I have multiple inserts like this: INSERT INTO category_product(id_category,id_product,position) VALUES(2,1,1); INSERT ...
0
votes
1answer
19 views

Can I use xtrabackup to import a database without altering others?

Context: Each time a demo branch is built, I want to download a copy of the prod database and setup it onto the demo server. This way under the MySQL I have X database corresponding to X demos. I ...
1
vote
0answers
14 views

Multilanguage category structure - standard vs. normalization?

I'm building a multilingual application and I need some advice on how to structure the table. Basically I have a category table based on nested set. There are 4 languages and I plan to enlarge this ...
0
votes
3answers
49 views

Duplicate values

Here is my table : PlayerId NoOfTeams 1 3 2 2 3 2 4 NULL 5 NULL I want to display PlayerID having same No.OfTeams including NULL values. Could any one please ...
0
votes
0answers
19 views

Signal in MYSQL procedure with parameters?

Following is from my MySQL dump DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `test`() SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Mobile Number Exists'$$ CREATE ...
1
vote
0answers
26 views

Strange MySQL replication error 1146 (Table doesn't exist)

I'm getting a very weird MySQL replication error No. 1146 for a REPLACE INTO query on a slave host replicating all tables in all databases from a master, and I'm having a bit of a hard time ...
0
votes
0answers
12 views

New To SQL and looking for some advice [on hold]

I have just finished my first SQL server class and would like to continue learning how to develop databases. The problem that I am having is that I am a noob at this, and I cannot think of a simple ...
0
votes
0answers
9 views

In MySQL 5.6, schema changes in master blocks the slave?

I have a question with a MySQL 5.6 master-slave setup. If you were to modify the master's schema with an ALTER TABLE SQL query, when the slave tries to execute that ALTER TABLE statement too, would it ...
2
votes
2answers
52 views

Is it ok to have 40+ columns in a table

I am currently re-designing some of DB's for a project. There is one DB in particular that is giving me a little of a headache. The idea is that for every client_id and date (client_id + date would be ...
0
votes
1answer
71 views

Increase performance WITHOUT adding indexes [on hold]

I'm having a rather large table (350MB, 1.3M rows) and there are dozens of queries arriving at this table every second. Most queries are super-fast thanks to indexes - but some others aren't. ...
1
vote
0answers
13 views

Sysbench insert data between a given range

I was trying to insert 1000000 records of data into 1000 tables in sysbench. But after installing about 278, sybench just crashed with the following error: FATAL: failed to execute function ...
0
votes
0answers
12 views

Are ZRM (Zmanda Recovery Manager) incremental backups reliable?

I had an issue while restoring incremental backups and I'm wondering if they are reliable. I'm making weekly full backups and daily incremental backups and I needed to restore a single database after ...
2
votes
1answer
31 views

What is the Best way to set Disaster recovery setup for percona Xtra DB Cluster?

We do have a Percona XtraDB Cluster(Master-Master-Master) setup in one country. Now we want to setup a disaster recovery setup in some other country. Please provide us the best possible ways to do ...
0
votes
0answers
34 views

Select these if this, or select these…

Here is my problem: organization_category.id can be either 1,2. With organization_category.id = 1, then the organization_type.id can be 0,1,2, or 3. With organization_category.id = 2, then the ...
0
votes
1answer
15 views

Select all results from two independent tables

I have two tables: Comments -------- id comment_content time_stamp Activities ----------- id activity_content time_stamp And I would like to combine the results from both, ordered by their ...
1
vote
1answer
16 views

How to Paginate a MySql Ranking Query

I have the following ranking query working fine with a limit of 25 records per page, it shows 1st - 25th for the first 25 records, but when i go to the next page, the rank stays the same 1st - 25th ...
1
vote
3answers
33 views

MySQL select with between optimization

I got issues with some geo IP query. So basically here is create code of table: CREATE TABLE `geo_ip_city` ( `id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT, `begin` BIGINT(20) NOT NULL DEFAULT ...
0
votes
0answers
12 views

upload updated details in excel to mysql database

I have a batch file which updates the excel file by adding the latest values to it. The details are already there in the MySQL as a table. Once the details are updated. For eg after the end of day ...
0
votes
1answer
22 views

How to update Large table in MYSQL

I want to update a large number of rows (more than 80k) from an external data source (from file) into an existing mysql table. This database is InnoDB. Database structure: CREATE TABLE IF NOT EXISTS ...
0
votes
1answer
19 views

Newly created user has rights on MySQL database

I use the root to create a new user, like this: I have no more operations on it. Then I use this user to log in: I try to do some operations like this: Here "test" is a database which I created ...
0
votes
0answers
17 views

Unexpected slow queries at random times

I have a moderate service, serving at most 100~ users at the same time. Mariadb slow log is open, and I occasionally see reports of slow running queries such as: # Time: 141123 19:48:38 # User@Host: ...
0
votes
0answers
20 views

Fast select = slow update, slow select = fast update

A query is super-fast when executed as a SELECT (#1), but when I try to UPDATE using the retrieved data, the performance starts to be unpredictable for me. For example, an UPDATE is faster with much ...
0
votes
1answer
17 views

MySQL rapid Data Replication from multiple Databases

I am a Freelance Web Developer but not a Database Administrator at all except basic Database Operations like DML etc. Today I got a client asking me to develop a Web based application but there is a ...