MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
1answer
29 views

Binlog not consistent between slave and master

Initially I don't see binlog on slave is updating. Today I discovered and add log-slave-updates option to slave, now it is updating. However, the filename does not match between slave and master. ...
0
votes
0answers
31 views

What is the best way to execute a MySQL script periodically on Linux

I want to execute some SQL everyday in a Linux server using MySQL to UPDATE some column's values. In order to do that I use the UPDATE ... SET ... WHERE ... statement. I want to know which is the ...
0
votes
1answer
60 views

MySQL SUM with multiple GROUP BY on same table

What is the best way to produce several sum results based on different group by conditions on the same table in MySQL? I believe I'm doing a bad select, but I can't figure out a better way. Imagine ...
0
votes
1answer
27 views

Dynamic my sql error

I am below error when i try to execute procedure. delimiter $$ USE `Test`$$ DROP PROCEDURE IF EXISTS `DYNAMIC_MYSQL`$$ CREATE PROCEDURE DYNAMIC_MYSQL() BEGIN DECLARE DONE INT; DECLARE CHECKNUMBER ...
1
vote
1answer
63 views

Friendship and Messages in a MySQL table relational schema problem (concerning big data manipulation)

Before you start suggesting this question for duplicate read it, I have searched and i haven't found any proper solution. So, i'm building a social networking site (I know that you are laughing ...
0
votes
1answer
32 views

MySQL stress test tool, remote server preferred

For MySQL stress test there exists programs: http://dev.mysql.com/doc/mysqltest/2.0/en/test-programs.html Also mysqlslap exists: http://dev.mysql.com/doc/refman/5.5/en/mysqlslap.html Is it possible ...
2
votes
2answers
118 views

High MySQL “InnoDB Writes Per Second” - Can't see the queries?

On our live MySQL 5.5 database server, we use MySQL Workbench for running manual queries, checking running queries to see what's going on, etc. I noticed today that on the "Server Status" tab there's ...
1
vote
1answer
48 views

Small startup: Cassandra + Hadoop or ElasticSearch

To give some context, I am from a small start up (4 team members) and we work in the education space. We've developed an e-learning platform that several schools are already using. We currently have ...
0
votes
1answer
26 views

Explain doesn't show indexed column as key

Consider the following table structure CREATE TABLE `games` ( `game_id` bigint(20) NOT NULL AUTO_INCREMENT, `players_no` tinyint(4) DEFAULT NULL, `startedon` datetime NOT NULL DEFAULT '0000-00-00 ...
1
vote
1answer
23 views

How do i increase the total MyISAM indexes?

I have just made a check for my server with mysqltuner. -------- Storage Engine Statistics ------------------------------------------- [--] Status: +Archive -BDB +Federated +InnoDB -ISAM -NDBCluster ...
3
votes
1answer
34 views

is it possible to do a reverse pattern search in a database?

I have 2 database tables with rows containing strings. If I combine two strings, one from each table, as input I need to be able to find where the parts of the strings are located in each table. For ...
0
votes
1answer
20 views

MySQL order of query

My query return like this. 12 14 14 99 78 78 54 I want result to be sorted so that no same number comes consecutively in the result. The result that I want is like this. 12 14 99 14 78 54 78
0
votes
1answer
14 views

How to check mysql password change and other events logs

Recently someone change my phpmyadmin password and drop database I think it was sql injecting. Now I want to find information about this like when, how and who change my password Please tell me ...
0
votes
1answer
16 views

Does the keyword NEW have the per-connection basis aspect to it?

I am watching a mysql table with an after insert trigger and i have started to receive many inserts.I am using NEW.message to get the last inserted message. Since i am receiving many inserts from ...
0
votes
1answer
30 views

What to monitor (key indicators) for MySQL server

I have installed Munin for monitoring my MySQL database server. It enabled a large amount of MySQL plugins out of the box. Since running these plugins can be CPU expensive I want to limit them to the ...
1
vote
0answers
33 views

Combining fields to make a unique record or keeping them separated

I've been asked to implement what has before, been a bunch of CSV files, into a MySQL database. I'm at a point in the design where all the schemas, tables and fields have been mocked-up; however I'm ...
0
votes
0answers
28 views

MySQL - Pivot-style (row -> column) results in subquery

SELECT j.departure, stopDepartures.* FROM journey j JOIN journey_day ON journey_day.journey = j.id JOIN service ON service.id = j.service JOIN pattern ON j.pattern = pattern.id JOIN ( SELECT ...
2
votes
2answers
61 views

Unexpected result from query based on old column value

I need to update a column and based on the old value, update a second column. After googling I came up with THIS (*nr 4) solution: copy the table to have the old value at hand. The table looks like ...
-2
votes
0answers
18 views

increasing Mysql DB Size and Server Size [closed]

I have installed xampp on my windows machine, i'm using MySQL, How to increase the size of mysql server and databases in it? Kindly help me..! Thanks in advance...!!!?
1
vote
1answer
32 views

MySQL keeps getting “connect” commands 100X per minute!

My server was having performance issues, things loading slow, pages not loading, etc so I ran the "top" command after logging in via SSH. I noticed the CPU kept jolting up to 40%, on and off, when ...
1
vote
2answers
75 views

Monthly report by time [closed]

I work in a parking company. We need a report of monthly vehicle exits by time. select hour(datetimeout) as 'dateout',count(*) from to_leaveveh where datetimeout between '2014-09-01' and ...
0
votes
2answers
46 views

Can you store PHP code in mysql database?

I'm creating a codex that will store example of functions and examples on how to use functions. Can I store this information in a database? Also, is there a proper way of displaying code on a page?
0
votes
2answers
27 views

Update a date_modified MySQL Record Field ONLY when other fields have changed using CASE statement not working?

I have asked my question on Stackoverflow but have not really gotten any answers so I am trying over here now. I have the MySQL query that is ran in a PHP script below. What it does is Inserts a new ...
0
votes
2answers
29 views

MySQL Count Rows with Two Cells the same

I have a db where the cells are height and width. (It's for banner ads) Some banners are the same width, but different height, or visa versa. for example: row1 hieght = 600 width = 120 row2 hieght = ...
1
vote
1answer
39 views

How to find non utf8 data in mysql

Ok so I have a mysql database containing data that is input from various customers. The customers are told that their data should only be encoded as utf8 however I have become aware that this is ...
0
votes
1answer
20 views

Automatic slave reconfiguration after updating master

I have development mysql master and slave servers and a prod server. I need to set up regular (once a week) syncronization of dev and prod databases. It would be easy for me to use prod# mysqldump > ...
0
votes
1answer
19 views

Is it possible to run a trigger on Table Creation in MySQL

Simple Question. Is it possible to create a Trigger that runs everytime a Table is created. The goal is to create a metadata table for each table, but I can worry about dynamically passing the table ...
2
votes
1answer
12 views

Creating Event that execute at end of each month

I need to create an event in mysql that runs at the end of every month 11 PM.I have tried creating an event that creates another events with code below: DELIMITER | CREATE EVENT ...
0
votes
0answers
23 views

Does MySQL have a visual tool for suggesting indexes like SQL Server's “Include Actual Execution Plan”?

SQL Server has a remarkably useful feature called "Include Actual Execution Plan" which not only gives you a visual diagram of your query, but also automatically suggests indexes that can improve ...
0
votes
0answers
34 views

MySQL - Database has huge overhead but tables don't

I have some problems with two MySQL databases. The databases have huge overheads but none of the tables do. When I recreated the tables the overhead just reappeared aswell. I hope you can help me. ...
0
votes
1answer
41 views

SELECT count vs DELETE JOIN. Why/how are they different?

Can someone explain in what way these queries could be different and the results are not the same? > begin; Query OK, 0 rows affected (0.01 sec) >select count(*) from tableA a JOIN tableB ...
1
vote
1answer
31 views

What happens when you have two events scheduled to run after identical n seconds?

I am running a survey and i am getting lots of data and i need to process that data quickly from within mysql.I am using a mysql events to help me process the hundreds of rows that i have. I have ...
0
votes
0answers
12 views

Validate hierarchy of two tables

I have two tables in my mysql database: Questions question_id Answers answer_id parent_question_id child_question_id Basically, I'd like to pass in a question_id, and have all child ...
0
votes
1answer
22 views

Best practices for relating NoSQL data to RDMBS

I am looking to use both a NoSQL solution (Redis, Mongo, etc) with a mySQL/Laravel application. My reasons for this is that I need a schemaless key value storage to go with my relational data. I could ...
1
vote
2answers
183 views

What is faster, one big query or many small queries?

I have been working for different companies, and I have noticed that some of them prefer to have views that will join a table with all its "relatives". But then on the application some times, we only ...
-1
votes
0answers
33 views

How does MYSQL Bin Log work?

I notice once I enable mysql bin log and do a restart on mysql service, there is a log file generated namely "mysql-bin.000001". So I did a quick test to modify database entries and eventually the ...
0
votes
1answer
21 views

Why does mysql allow me to enter password for non existing mysql user

My mysql server has 2 users - root robb But when I try to login with another user it let's me enter password - hussain@magic-laptop:~$ mysql -u jon -p Enter password: Shouldn't it give an error ...
0
votes
0answers
25 views

SQL query to fetch results for multiple many to many relationship tables

We are developing a database for storing licensedetails of source code, archives, shareobjects, binary. We parse a detailed build and extract list of source files that make objects, list of objects ...
1
vote
1answer
37 views

Is it possible that records are changed while a read query is still executing?

Suppose a read (select) query R is reading some 100 records from a table, 50 records are read so far, could in the meanwhile a write query W change some of the unread records? We didn't take any ...
0
votes
1answer
68 views

Very slow response even with a high number of available connections

I'm running this server for data mining purposes. It runs several compute-intensive data mining applications in parallel and does simultaneous access to the MySQL server. Here are the ...
1
vote
2answers
57 views

Does a whole-server backup guarantee a reliable backup of running databases?

Many hosts offer a full-server backup once per day. However, I've been told that a backup of this kind doesn't guarantee a reliable backup of running databases, because even if the database uses ...
1
vote
2answers
175 views

Relational Model vs. Database Products [closed]

The formal Relational Model (logical level) for databases is not exactly the same thing as you get with MySQL, Oracle or other major products / implementations of ‘relational’ database management ...
0
votes
0answers
28 views

MySQL hook and alter incoming INSERT queries?

We have an application running on a server which parses an xml data feed into SQL queries and executes them continually 24/7. There is a serious issue in the design of the queries and we need to ...
1
vote
2answers
36 views

Unable to SQL => Getting content of last 7 days

I thought I was good with SQL till I was told to get the content of all 30 days. I do have a column called "connect_time" which has date and time in the following format: 2014-08-28 11:11:42 All my ...
0
votes
1answer
18 views

Testing data integrity porting from old database to new

I've created a Web/ASP.NET/MySQL database front end & back end that gets created from the XML logs from a previous Java based XML client-server that is not serving the company very well (the XML ...
0
votes
1answer
54 views

Appropriate use of mysql Optimize Table

I want to come up with some best practice for maintaining our mysql database. versions 5.5/6 and using InnoDB. i came across this artice - ...
0
votes
0answers
23 views

store code/script value as text in database

I have the following situation: I have to work with software, developed in Java, that allows the user to input some custom scripts in order to do some calculations. so i have to store/save the ...
1
vote
1answer
42 views

What drawbacks are there in scheduling an event to run every too often,say after every 60 seconds?

I have this event i want to run every 60 seconds but i wonder if this will take up many resources in my database. CREATE EVENT myevent ON SCHEDULE EVERY 60 SECOND DO UPDATE ...
2
votes
0answers
21 views

Translate SQL Server update statement to MySQL

I have a development environment with MySQL and a production environment with SQL Server. This update statement works with SQL Server: UPDATE THIS SET <list_of_column_assignments> FROM ...
0
votes
3answers
29 views

What's the proper design for the table that will hold the processor load stats?

Let's say that I need to implement a widget on the site that allows the user to view the processor load stats via a chart. The user will be allowed to choose how detailed the statistics are: with ...