MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
5 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
0answers
6 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
3 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
0answers
3 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
1answer
16 views

MySQL Multi Count

How can i get this result? ╔═════════╦═══════╦═══════╗ ║ EventID ║ User1 ║ User2 ║ ╠═════════╬═══════╬═══════╣ ║ 1 ║ 1 ║ 2 ║ ║ 2 ║ 2 ║ 3 ║ ║ 3 ║ 3 ║ 1 ║ ...
0
votes
0answers
6 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
5 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
14 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
19 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
29 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
19 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
11 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
47 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
17 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
35 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
21 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
18 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
13 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
47 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
18 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
24 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 ...
1
vote
2answers
43 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
12 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
11 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
30 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
14 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 ...
0
votes
1answer
30 views

Unknown column in 'where clause'

I've a query in my php script $result = mysql_query("SELECT State_Id FROM state_master WHERE State_Name='$statename'") or die(mysql_error()); $row=mysql_fetch_assoc($result); return $row['State_Id']; ...
1
vote
1answer
30 views

Is a query inside mysql IF clause allowed?

DELIMITER $$ CREATE PROCEDURE `InsertUser`(IN passwd VARCHAR(100), IN userType VARCHAR(20), IN mobileNo VARCHAR(20), IN refId BIGINT(20), IN companyName VARCHAR(100), IN companyMail VARCHAR(200), IN ...
2
votes
1answer
28 views

How much space is needed to reclaim space from a table in INNODB

I inherited a MySQL InnoDB table that has approximately 200 GB worth of data, as well as several unneeded indices that amount to approximately 500 GB. I've archived approximately 75 percent of the ...
-2
votes
2answers
52 views

What's wrong with my SQL statement? [on hold]

I'm trying to execute: create table `certificates`( `id` INT NOT NULL AUTO_INCREMENT, `common_name` VARCHAR(100) NOT NULL, `csr` LONGTEXT NOT NULL, `type` VARCHAR(100) NOT NULL, `certificate` ...
1
vote
1answer
23 views

Does a database update force index rebuild regardless of updated field?

With MySQL (InnoDB), I understand that having indexes slow down UPDATE queries. I would like to know if this happens regardless of what fields are updated. For example, if I have a table with 20 ...
1
vote
1answer
51 views

How to get the SUM between dates in a WHERE clause?

I'm trying to get the SUM between each date in the WHERE clause of the following query, not the cummulative sum, but the sum for the period in between the dates. For example: Query: SELECT ...
2
votes
2answers
30 views

Joining two Mysql VIEWs takes a very long time

I have a textbox (for which I used jQuery auto-completion) in my PHP form where user can insert an actor/actress name and then by clicking "Search" button, a new window is opened showing list of ...
1
vote
1answer
59 views

How to combine two queries? [on hold]

I can't explain this very well except by spelling it out. I start a query on ID, and from there I can get TITLE, DATE, and REGNUMBER. The problem is I also want to get 'where,' which is also stored ...