MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
1answer
53 views

Is it possible to emulate the WITH command in MySQL 5.1.73? [closed]

I have the following query: SELECT COUNT(*) AS `count` FROM agreements WHERE start_date >= STR_TO_DATE('14-01-2015','%d-%m-%Y') AND start_date < ...
2
votes
1answer
46 views

ibdata1 increases when firing update queries [duplicate]

I have read a lot of posts which explain that the only solution to stop the growth of an ever increasing ibdata1 file is to: Take a dump of all databases Set innodb_file_per_table in the mysqld ...
0
votes
0answers
12 views

Does pt-table-checksum work in circular replication environments?

I have 3 masters in circular replication. I run pt-table-checksum in one of the masters only. A->B->C->A The queries do get replicated the "next" server B but I don't think they are being replicated ...
0
votes
0answers
17 views

Scheduling large numbers of events in Mysql

Looking at using the Mysql event scheduler to schedule potentially quite a large number of events which could be in the 100,000's of discrete events per day (possibly more). Does anyone have any ...
0
votes
1answer
60 views

unable to insert utf8mb4 characters in mysql 5.6

recently i was facing problem in inserting emoji and other 4 bytes character in my mysql database then i found that my mysql version was 5.1 and it does not support utf8mb4 so i upgraded to mysql 5.6 ...
0
votes
1answer
28 views

MySQL performance of applying unique constraint single column vs combination column

I have a large MySQL InnoDB table containing around 137 million rows. I need to add a unique constraint to the table. We have two options: 1) A combination index on three columns, one of which will ...
1
vote
1answer
28 views

Audit Plug-in in MYSQL 5.7.5

Following error occured while using installing MariaDB Audit Plugin Library (i.e. server_audit-1.1.8.tar.gz) in 5.7.5-m15 MySQL Community Server (GPL) in Centos release 6.5: ERROR 1126 (HY000): Can't ...
0
votes
3answers
22 views

mysqld is generating a lot of disk IO writes. How can I figure out why?

I have a Ubuntu 14.04 server running half a dozen wordpress sites. Total traffic to the server is on the order of 30k page views a day. Over the past couple months, with page views and network ...
0
votes
0answers
11 views

MySQL GROUP BY performance not improved by 1-column vs 2-column condition

mySQL 5.6.22 on 32GB RAM CentOS I was very surprised that this change did not improve GROUP BY performance. It's a query with multiple joins, of course run with SQL_NO_CACHE option. In my original ...
0
votes
0answers
19 views

Is a update-only-once-row table worth sharding?

I have a big MySQL 5.6 Inno DB table that contains user's request. A table row updates only once, shortly-after the initial insert! (The initial insert is to get the unique auto-incrementing ...
0
votes
0answers
15 views

Transferring specific records from one database table to a similar table on a different database

I have some records in sh_posts table of the database from our old website that I would like to move to htec_posts on our new website. Using phpMyAdmin, I searched sh_posts for post_type ae1ec_events. ...
1
vote
1answer
45 views

How to properly aggregate?

I have a table for logs with over 6 million records. I want a query that shows me all the occurrences where the src goes to the same destination/port. I tried this: SELECT src, dst, dstport, ...
0
votes
1answer
37 views

same table on different commands (inner join)

Testing some commands of MySQL, I've come across these two comands resulting on the same table. Command 1: select sales.relatory_code, sales.date, destiny.exportation_name from sales, destiny where ...
0
votes
1answer
59 views

MYSQL: How to improve performance of inserting over 1M rows to a table with over 100M indexed rows

I have this mysql table: CREATE TABLE `codes` ( `code` bigint(11) unsigned NOT NULL, `allocation` int(11) NOT NULL DEFAULT '0', `used` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`code`), ...
0
votes
2answers
60 views

Database structure for hierarchical quiz?

I'm doing a personal project where I have a quiz with a number of boolean questions. Each question will have a two answer choices "true" and "false". Based on the selected answer, a new question will ...
0
votes
1answer
56 views

Free universe tool monitoring all database [closed]

Is there any free tool to monitor most popular databases like Oracle, MySQL, MSSQL, PostgreSQL. I want to monitor the real time performance of all the above mentioned databases with a single tool like ...
0
votes
1answer
20 views

MySQL connection logs backtrack

Is there a way to backtrack who connects to MySQL server? Aside from show processlist;? I want to see who connects last day. Thank you.
0
votes
1answer
25 views

mysqldmup with data only

Is there a way to backup data using mysqldump --no-create-info ... where the inserts in the backup file will look like this: insert into t1(col1, col2)values(val1,val2); instead of insert into t1 ...
0
votes
1answer
19 views

Hits to Insert Ratio and Insert to Prune Ratio

I'm confused with Insert to Prune Ratio. As I understood, for example Hits to Insert Ratio: Hit:Insert 0.47:1 is very bad (more inserts, then hits, hence - server waste resources to insert in ...
3
votes
3answers
115 views
+50

Clustered index performance consideration in MySQL & PostgreSQL

In MySQL/InnoDB, the clustered index is synonymous with the primary key, so picking up a poor primary key affect your db performance, i.e. use of UUID as PK is a performance killer for database write. ...
0
votes
0answers
39 views

How to use a subquery that returns multiple rows?

I am getting Error 1242 : Subquery returns more than 1 row. Basically, I have to do this : select data from my database based on a time criterion (between 2 dates) and then apply a filter on the ...
0
votes
0answers
17 views

How to execute a mysql prepared statement on different database?

Is there an option to execute a prepared statement on a different database? ex: USE @database PREPARE pstmt FROM @stmt; EXECUTE pstmt; DEALLOCATE PREPARE pstmt; I need to set the database ...
0
votes
0answers
24 views

Need a High available for Database : HA clustering vs failover with mysql utilities

I intend to setup a high available for database system, I have 2 solutions here : Set up a HA clustering with heartbeat and share storage for 2 nodes as master(to storage the configuration and data ...
0
votes
0answers
38 views

How to insert into MySQL table SUM of two cells from different tables using insert function

I want to make sum of two cells from different tables in MySQL using INSERT function. The code that I used is: $panoue="INSERT INTO usi2(latime_paneli, inaltime_paneli, latime_panele, ...
0
votes
0answers
31 views

mysql memory usage increasing

We have recently been facing consistent issues with mysql memory on almost all of our machines. Through the course of the week, we see the memory rise gradually until the machine starts swapping and ...
0
votes
1answer
41 views

problem with query two different tables with foreign key relations

I am having a problem with querying two tables with different foreign key relations... My first query works fine but when adding another table with a different set of relations I am having a ...
0
votes
0answers
21 views

Use an API key for MySQL login instead of password

Basically I am using a MySQL account in an application to send data back to me so I can use it in various ways, but this of course degrades my security. Anybody can login to the account and cause ...
0
votes
1answer
29 views

select statement for subtype

Okay, so all I'm trying to do here is list the managers who supervised the employee that charged a customer $100 for a rental on November 1st, 1998. My issue is that I don't know how to select the ...
0
votes
1answer
81 views

Not able to solve issue: Incorrect string value: '\xC5\xABt\xC4\x97'

I am facing database error Incorrect string value: '\xC5\xABt\xC4\x97'. I did a lot search and tries a few ways, include move from utf8 to utf8mb4. But still not able to solve it. Following are the ...
1
vote
4answers
73 views

How to make a remote mysqldump?

I know that's it's possible to do a remote mysqldump if I specify --host but is it possible to create the file in the remote server as well?
1
vote
2answers
50 views

How to solve intermittent MySQL performance issues on simple queries?

We are currently experiencing an intermittent issue with UPDATE/DELETE/INSERT performance. Simple queries like the following take a long time: DELETE FROM ip_filter WHERE filter_id = '348'; ...
0
votes
0answers
22 views

Best configuration for high speed insert in Mysql using innodb engine

I am using apache storm to process csv files and insert the output to mysql. Apache storm process the data and produce output at a very high speed. I find Mysql inserts comparatively very slow. How ...
1
vote
2answers
50 views

Creating index on large MySQL table taking forever

My table has 981 million rows and is about 30GB large. It is six columns: ID, Ticker, Date, Time, Price, Volume. The data was in text files and using LOAD DATA INFILE was actually quite painless and ...
3
votes
1answer
111 views

Stored Procedure to update an adjacency Model to Nested Sets Model

If you don't already know, these two models are the most common ways to store a tree in a relational DB. Adjacency Model: +-------------+----------------------+--------+ | category_id | name ...
0
votes
0answers
41 views

Design a database with test table with different answer format

I am designing a database with tables: For each test,there should be a template and one test has many product code and each product code has or has no attribute. tb_template(id,name) ...
0
votes
0answers
20 views

tmp_table_size and max_heap_table_size setting

Does anyone know whether or not setting global MYSQL variables(tmp_table_size and max_heap_table_size) to the same value will prevent Converting HEAP to MyISAM (since there should never be a temporary ...
0
votes
0answers
15 views

Search column, get row of result, check if another column in the found row has a certain value [migrated]

id user profile profile id 1 mark data 12 2 john time 13 3 sinc time 13 4 alex data 12 I have the above table called users in a database called rd. Is there a ...
0
votes
2answers
39 views

How to get sum of the rows of 3 tables

I have 3 tables and I want to know with one query sum of row's number in 3 tables I tried 2 different queries but it they give only the number of rows each table and I c'ant read with, return ...
1
vote
1answer
47 views

Clarification for database creation and relations

I've trying to make database with few tables and relations between them. As I'm not very good in databases at all I need some clarifications. The idea is to connect table with table_1, table_2 and ...
0
votes
2answers
46 views

Hierarchical data in MongoDB?

I have a question regarding Hierarchical data. Our app shows posts, that are structured inside parents. Here's how it goes: prof->sprof->subject->post (Each prof can contain multiple ...
0
votes
1answer
39 views

selecting table1 and table2 with single data row and table 3 with multiple data rows

I want to retrieve data from table1(payments), table2(properties), and table3 (property.assessments). See my visual representation below: tables screenshot Snippets: SELECT a.payment_id, ...
0
votes
0answers
44 views

Is there any way to improve this code?

SELECT tblstud.studid, tblsched.ip FROM tblstud LEFT JOIN tblstudsched ON (tblstud.studid=tblstudsched.studid) LEFT JOIN tblsched ON (tblstudsched.schedid=tblsched.schedid) ...
0
votes
0answers
15 views

Local Server Slow When Joining

I have two cira 600MB tables that I am querying as such: SELECT id, name, url FROM names, urls WHERE metaphone = 'ALX;FLX' AND urlId = urlRef; This runs fine on my live server ( ~ 0.02 sec,) but on ...
0
votes
1answer
29 views

GET_LOCK([name], 0) behaviour and multiple GET_LOCK() order

I read from the documentation that the behavior of distributing a lock requested by many connections after RELEASE_LOCK is called from the connection holding the lock is undefined. I was curious: say ...
0
votes
0answers
18 views

Mysql native driver or just use pdo

I am now exploring on prepared statement. I was using the codes below. $link = new mysqli(dbHost, dbUser, dbPassword, dbDatabase); if($link->connect_error) { die('bind_param() failed: ' . ...
0
votes
1answer
45 views

MySQL over total memory allocated usage? memory leak?

i'm using 5.6.21-70.0 for performance test. when i run mysqlslap -a --concurrency=40 --number-of-queries 1000 --iterations=500 --engine=innodb --debug-info -utest -p do some performance test ...
0
votes
1answer
39 views

Big table with simple queries, but with a lot of text, is it bad for performance?

I am making cache table for website. It will have no problem with indexes (one unique index, simple quires), but it will have a lot of utf text. It will be 10-15gb (2 mln rows). Caching will help a ...
0
votes
0answers
22 views

MySQL blob removes last bites when selecting in some strings

When I retrieve blob it get cut from the end a little. Most strings are ok, but some got cropped for several last charecters. echo $data, '<br />'; db_execute("UPDATE table SET blobcolumn = ...
0
votes
1answer
48 views

How do I report progress of a long running transaction in MySQL?

I have this transaction in a stored procedure: ... START TRANSACTION; WHILE @Codes > 0 DO EXECUTE qry_rand_stmt; EXECUTE qry_insert_stmt; SET @Codes = @Codes - ROW_COUNT(); END ...
0
votes
1answer
32 views

DELIMITER issue in MySQL 5.6

Drop procedure if EXISTS rotatepjp; DELIMITER // CREATE PROCEDURE rotatepjp() BEGIN DECLARE u_id, settingval, pjp_userid, pjp_beatid, u_frequency INT; DECLARE u_pjpstartdate, pjp_fordate, ...