MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
10 views

InnoDB Table has backed up INSERT and UPDATE queries, high CPU

I am running an MySQL DB with all InnoDB tables. I often have many queries backed up for the same table when I run SHOW PROCESSLIST; Basically, I keep a table of every logged in customer and update ...
0
votes
1answer
26 views

query that was working on MySQL but is not working on PostgreSQL

I had the following query (with bin_number being a string) which was working on MySQL 5.5 Postgres - was working on MySQL and doesn't work on PostgreSQL SELECT "menu_items".* FROM "menu_items" ...
5
votes
1answer
316 views

SQL Query challenge

I have what seemed like an easy query to write, that really has me stumped - can anyone help me please? So this is really easy on paper, but I can't translate it into SQL. Lets say you have some ...
0
votes
1answer
32 views

Get the latest record and count them with time interval

I have a table as below id fk_sales_id status created_at 1 001 5 2015-02-17 16:45:44 2 001 8 2015-02-18 18:45:44 3 002 30 2015-02-20 16:45:44 ...
0
votes
0answers
15 views

I want to rewrite my MySQL query so that FIND_IN_SET doesn't do a full table scan unless necessary

I want to rewrite my MySQL query so that the last table join doesn't do a full table scan unless necessary. Here's what I mean. Under certain conditions I don't need to select any rows in that join ...
0
votes
1answer
22 views

sql query for hierarchal search [on hold]

In the below relational table, I want to search all user id's whom are are under any particular sponsorid in hierarchical manner User Id Name Sponsor Id 10030080 TULSI RAM ...
0
votes
0answers
9 views

MySQL Server Install Setup Types Developer Default vs Full

As I'm installing MySQL Server Community Edition the possible Setup Types are: Developer Default Server Only Client Only Full Custom Is there any difference between options Developer Default and ...
-2
votes
1answer
18 views

How to implement a distributed database system [on hold]

I have been tasked to find out how to implement a distributed database system using the various database management software available like: MS Access 2013, MySQL and PostgreSQL. How would I be able ...
0
votes
1answer
28 views

combining two different record into single result

I am fetching data from 3 tables with the help of join. My output is in JSON format. Output in JSON format:- {"order_id":"2", "location_address":"Testing location Delhi", ...
-2
votes
1answer
37 views

how many database tables is too much?

I'm working on a project for a school and so far I have 91 tables! Everything is linked to the student table, is it normal to have this many tables in one database? or do i need to make multiple ...
0
votes
0answers
13 views

Export MySQL query log to JSON format

Is there any tool which is capable of exporting MySQL query log to JSON format (or any other structured format)?
0
votes
1answer
31 views

Finding the same value in a column and only returning rows without the same value

I have a query that i have to find the DiscountPercent that are the same and not show the rows with the same DiscountPercent. I have tryd this and it brings back the values that are the same SELECT ...
0
votes
1answer
11 views

Unable to get any type of connection using mysql on LAN

My question is rather simple, I have a Windows 7 machine that is hosting an Apache server and a MySQL server using the XAMPP control panel. Both of these have been installed as a service on the ...
0
votes
1answer
38 views

How to merge two databases, both with primary keys

I have two databases, both with the same tables, but the data is out of sync. I need to add data from database A to database B, but not overwrite any data in B that exists in A, instead add it with a ...
0
votes
1answer
22 views

How to restore database from /var/lib/mysql

I have a database folder from a crashed server called gain_wordpress. I'm trying to put that database on a new server but I'm not able to do it successfully. I don't have a .sql dump, all I have is ...
0
votes
1answer
21 views

Change MariaDB 10.0.17 (MySQL) master to a slave

I have a MySQL master/slave configuration -------- -------- | master | -> | slave1 | -------- -------- I want to kill my current master, transform slave1 to be the new ...
0
votes
0answers
9 views

How to create a communication link failure in MySQL

For testing purposes I would like my MySQL server to generate a communication link failure (com.mysql.jdbc.exceptions.jdbc4.CommunicationsException). How can I tweak MySQL that this error is easily ...
1
vote
2answers
23 views

mysql - order by first condition in where clause

I have a table consists of the following fields id, name with the following values 1, ciro 2, test ciro 3, ciprox 4, other 5, other i would like to get all the values that begin with "ci" or ...
0
votes
0answers
17 views

Need a table schema for general store app [on hold]

I am Developing one application for online general store and stuck some where near making a schema for the products. Here, Every Product has brands and Product can come in multiple varieties like for ...
0
votes
0answers
10 views

Mysql cursor alternative / Optimization - each row updates are too slow

I'm looking to optimize my cursor based update or actually replacing it... Situation We're carrying out promotional campaigns and I'd like to track user activity per campaign. Logic Each campaign ...
0
votes
1answer
20 views

delete query performance issue on mysql

I have two tables table1, table2 where table2 is a subset of table1 (basically created with the query create table table2 as select * from table1 where .....) Now, I am trying to run the below query. ...
0
votes
0answers
22 views

Subquery optimization

I was reading through this article - http://explainextended.com/2009/09/18/not-in-vs-not-exists-vs-left-join-is-null-mysql/ I am working with an existing design. What I want is to be able to select ...
0
votes
1answer
21 views

Unable to get the latest value added to Mysql table based on posted time

SELECT * FROM discussion_comments GROUP BY disc_id ORDER BY posted_date DESC I have table example like given below: CREATE TABLE example ( id int(11), cname varchar(11), posted_date date, ...
0
votes
1answer
20 views

What is the performance benefit when using a temporary table to update a regular table?

I'm trying to understand what the performance benefit between two different methods of updating multiple table rows. For the first method we have an explicit update statement for each line to be ...
0
votes
1answer
16 views

Access denied to user@localhost

As a root user i did this: GRANT DELETE, SELECT, INSERT, UPDATE, EXECUTE ON dbName.* TO 'user'@'localhost' IDENTIFIED BY 'apassword'; In 'dbName' i created a procedure 'proc_name' with definer set to ...
0
votes
1answer
19 views

Optimize Query in MySQL

I've following tables with respective fields 1) wi_individual_g(ind_id,ind_is_recepient,ind_deleted,ind_district_id,...) - Around 200K data 2) wi_individual_p(ind_id,prg_id,...) Around 250K data 3) ...
0
votes
0answers
14 views

Use ID from another mysql database?

I have a mysql database for form submission (written in PHP) data and a mysql database for CRM (using X2CRM) on the same server. When a form is submitted on my website the POSTed data of the form ...
0
votes
0answers
20 views

Allow only parent DELETE cascade to delete child rows

I have a Product database with the following components: ProductOptions is a list of option names for each Product, ProductVariants is a list of variants for each Product and ProductVariantOptions is ...
0
votes
1answer
24 views

Guidance in creating a database for parks division attendance data [on hold]

We(group project) are trying to design a mysql database for our client which is a division of Off-Highway motor vehicle parks. Our client keeps tack of attendance data by month of many different ...
0
votes
0answers
12 views

Multi tenant database: Join table between 3 tables (user-role-company)

When designing a multi-tenant design i face this problem: One User can have multiple Roles, one Role can have Users (m-n) One user can be part of multiple Companies (organizations) and Vice-Versa ...
0
votes
0answers
16 views

Slave executing queries with different charset

I need to change a database charset because of this issue and I solved my issue in staging environment with the SQL command ALTER TABLE `articles` CONVERT TO CHARACTER SET utf8 COLLATE ...
0
votes
1answer
41 views

SELECT COUNT(*) expensive query mysql?

I have following query: SELECT COUNT(*) AS `numrows` FROM (`phppos_items`) WHERE `deleted` = 0 explain: mysql> explain SELECT COUNT(*) AS `numrows` -> FROM (`phppos_items`) ...
0
votes
1answer
18 views

Select range of non-identical date from different table

On MySQL5 with innoDB, I have sensor data in multiple tables, all with an ID and a DATETIME field, like so (two tables shown, but there are more). The IDs and DATETIMEs are not identical between ...
0
votes
0answers
17 views

How we resolve Mysql Enterprise online backup error with “CORRUPT LOG RECORD FOUND” log error

I have configured my production MySQL database with MySQL Enterprise "online Backup" option. The configuration was went through successfully. When the assigned scheduler is try to take backup then i ...
0
votes
1answer
26 views

how effective creating 2 database with same content?

I'm in a dilemma if creating redundant database will speed up the access considering only the CRUD factor. Is it effective to create a dedicated DB for creating/updating/deleting records and a ...
0
votes
0answers
39 views

Why is MySQL not saving inserted data?

So I have the following insert statement that I run through MySQL Workbench: INSERT INTO PeakOnlineCount (time_stamp, LocationId, Count) values ('2015-03-26', 0, 1) If I run the following query: ...
0
votes
1answer
39 views

LEFT JOIN DEFAULT NULL VALUE

I had query simplified like this : SELECT a.id, a.name, b.* FROM a LEFT JOIN b ON a.id=b.id Which b is from group concat select (very dynamic column). Sometime there are 3 column in b, sometime ...
-2
votes
0answers
13 views

Can anyone tell me which programming language is from www.freelancer.com, www.clickbank, www.craigslist.org and www.pof.com? [on hold]

I want to build a site like www.pof.com and advance search area is my favor (key word post and match and searching). Any one can tell me better, simple and easy to apply and manage in the future for ...
0
votes
1answer
26 views

MySQL query where one column is equal to another [on hold]

I've written the query below (that is not working as desired): update payments set payments.commission_id = ( select commissions.id from commissions where ...
1
vote
2answers
31 views

MySQL silently replaces UTF chars with literal question marks

I'm experiencing a situation similar to this SO question i.e. I'm working with a legacy database which has UTF8 content in latin1 tables (pretty ugly I know). Now I'm getting new data from a new ...
0
votes
1answer
27 views

mysql upgrading from 5.1 --> 5.6 do I have to do mysqldump before upgrade?

I was reading this document: http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html It says when upgrading from mysql 5.1 to do a mysqldump and then a reload. Is there anyway ...
0
votes
0answers
17 views

MSQL bin-log location is not being updated [on hold]

I've set up the location of bin-log files of my mysql server. Now I want to change this location, however updating the field in my.cnf now does nothing. MYSQL just continues to create bin-log files in ...
2
votes
1answer
30 views

How to keep updates (diffs) of some entity in the database

What is the best way to keep updates (diffs) of the some entity in the database? At StackOverflow we can edit questions and answers. And then we can look at any revision of the question or answer we ...
0
votes
1answer
23 views

Why can't I use a cname/alias in the permissions table?

At work we have a usual setup with web server(apache) and database server(mysql). From time to time there is the need to migrate the web stuff to a new server. Lets say their a records are dull and ...
0
votes
3answers
21 views

MySQL Date field: filter by LIKE vs MONTH()

I have a CRON task that needs to extract customers with birthday in a given month, from a MySQL INNODB table. The birthday field is indexed and of type DATE. I can query the customers table by either ...
0
votes
2answers
20 views

How to use a trigger to only insert one row

I am doing a third year project using an intel galileo that reads an RFID card, and signs a student into a class, and I am using multiple tables. I have nearly completed it as all reads are been ...
-3
votes
0answers
25 views

Transact-SQL, Ms SQL, My SQL [on hold]

Luckily for me to see your answer to the question on find all numbers that appear at least three times consecutively. I am a beginner with MySQL. I am trying to solve database problems on ...
-2
votes
0answers
11 views

What are Client Access Profiles and what are they used for?

Can someone please explain to me what Client Access Profiles are, and what they are used for? I have not able to find 1 single thing about them online in the past week.
0
votes
0answers
17 views

How to restore mysql database in XAMPP using backup of mysql folder?

I have a backup of the entire xampp/mysql folder. How can I use it to recover my old db on a fresh installation of XAMPP? Simply copying the old xampp/mysql folder to new xampp leads to mysql errors ...
0
votes
0answers
6 views

Is it possible to ADD 2 EER model from 2 differents database in the same editor screen in MySQL Workbench?

I am using MySQL workbench to visualize a EER model form one database, lets says db1. It is a 166 tables database. Then I have another database, that interacts with db1, that has 10 tables. So I have ...