MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
1answer
914 views

Query to take partial backup in MYSQL

I tried to take full backup in mysql using enterprise backup by using the command mysqlbackup -u root -p --backup-dir=g:\full_bck backup But I could not take backup of a single database , I ...
1
vote
1answer
117 views

How can I reinitialize some MyISAM tables without restarting MySQL?

I'm using rsync to copy some measurement data from one PC to the server. Is it possible to load the new MyISAM tables without restarting the MySQL server?
1
vote
1answer
366 views

Should this be an identifying relationship or not?

Well I've attached the image to explain what I need to know: I thought it was supposed to be an identifying relationship, but now I kinda thought maybe it wasn't? The thing is the user won't ...
1
vote
2answers
5k views

MySQL Workbench is not finding MySQL service?

I set up a local MySQL server, currently with no databases. I'm trying to create a new server instance profile in MySQL Workbench to manage the server, and during the Create New Server Instance ...
3
votes
1answer
343 views

MySQL licensing [closed]

I have looked at a few questions posted in stackoverflow http://stackoverflow.com/questions/225987/can-someone-explain-mysqls-license-and-what-it-means-to-closed-source-developme ...
2
votes
1answer
562 views

How to removing or reduce the size of redo logs in MySQL cluster

Can anybody tell me that how can we reduce the redo log file size or can we remove the redo log file size in MySQL Cluster and also what will be the impact of it on performance of cluster.Also can we ...
2
votes
1answer
1k views

Is a query with UNIX_TIMESTAMP using indexes in mysql?

If I use .. WHERE UNIX_TIMESTAMP(`some_timestamp`)>NOW() in a SELECT, does this query still make use on an index, set on some_timestamp ?
2
votes
3answers
3k views

Deleting Data From Multiple Tables

Suppose,I've a table called UNIVERSITY containing universities name: universityID universityNAME isACTIVE 7 GNDU 1 6 PU 1 5 ...
3
votes
1answer
2k views

MySQL - Create a function from another function

I want to create a function same like my old functions. When I create a table, I can use `AS to other table as follows: CREATE TABLE dummy2 AS SELECT * FROM dummy1; Can I do the same thing with ...
0
votes
1answer
544 views

INNER JOIN between 2 tables vs WHERE on one table performance

Suppose I have two tables: CREATE TABLE `doctors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `clinic_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; ...
6
votes
1answer
10k views

What's the most efficient way to batch UPDATE queries in MySQL?

I'm writing an application that needs to flush out a large number of updates to the database for an extended period of time, and I've gotten stuck at how to optimize the query. Currently I'm using ...
5
votes
2answers
21k views

How do I automatically grant all privileges to a schema created by a user in mysql?

Someone new joined the company and I created an account for her in mysql using the following: CREATE USER 'username' IDENTIFIED BY 'password' She needs to create her own schema and so used: GRANT ...
6
votes
2answers
343 views

mysql performance / cache configuration enigma [closed]

I have two mysql 5.1 instances (say A, B) hosting the same database schema. If I run (with mysql workbench) the same query on both instances I don't understand why I get very different response times ...
3
votes
2answers
3k views

Can I do anything about a very long running KILL command?

I've got a table with 103M+ records in it and takes up 70GB on the disk. I decided to DELETE (in one statement) 70% of the records. As expected, this took an awfully long time to run. I decided to ...
0
votes
1answer
165 views

What MySQL storage engine and table schema should I use?

I am making a web project and I created necessary and the most important table, but I am not sure that I did it right. In this site users will post data like text, picture, text's category, etc. I ...
1
vote
1answer
197 views

Why does a MySQL MEMORY-backed table take so much more space than on disk?

I have a single InnoDB table on disk, with ~1,107,423 rows and taking up 45.6 MiB disk space. The structure is: messageid int(11) signature varchar(255) When I create a MEMORY-backed version of ...
-2
votes
1answer
2k views

Which is the shortest way to find out if a float IS NULL or equals 0 in mysql [closed]

I want to type the least possible characters, to find out all columns in a table that are 0 or NULL In this example I explain it further: lets assume the table test CREATE TABLE IF NOT EXISTS ...
2
votes
1answer
295 views

MySQL generic trigger to save identification data for later accessing of the changed row

I am pretty inexperienced with this. I need a generic trigger, able to create and save in a fixed table some sort of identification data for a changed row from generic (any) table. The ...
2
votes
1answer
149 views

Ranking System with Different Categories

I want to create a system where the user can be ranked by several different factors. For example, the user competes in the following categories Wins Points I need to know what the position of the ...
1
vote
1answer
3k views

How to COUNT number of rows with LIMIT?

I want to catch X rows, thus, I set LIMIT X; but how can I simultaneously count the total number of rows too? Currently, I use two separate queries to do so as SELECT COUNT(*) FROM col WHERE CLAUSE ...
0
votes
1answer
141 views

MySQL query optimization

I'm quite new to big MySQL queries (I used to extract raw data from tables then manipulate them with PHP) so I'd like to know if my query below is too "heavy" or slow for some reason (it seems to be ...
3
votes
2answers
846 views

Save history editable data RDBMS

I want to make application like testing system. Every question has one or many variant of answers (and one or many can be right). I apologize that tutors and students use my testing system. It means ...
0
votes
0answers
151 views

can not insert big data to mysql database [closed]

I am trying to save big data to database I extend the max_allow_packet and post_size but nothing happened. the code and database released to production server and to stage server on production server ...
3
votes
1answer
49 views

MySQL Help with Desktop Based Administration

I am making a MySQL based database for a professor and she would like to have a version uploaded to the web and a version on her desktop for personal use. The web version would be "official" whereas ...
0
votes
1answer
79 views

Max and group by query help [closed]

We have query as below. What we need is to select particular training with latest date and only single data but now when we run the query below we get more then one results. SELECT ...
1
vote
0answers
85 views

MySQL: Assessing performance of a query by using EXPLAIN

It is said that the number of rows are scanned is smaller the performance is higher when use Explain to optimize query. So I wonder When the EXPLAIN output includes many rows, is there any formula ...
1
vote
2answers
842 views

How do I remove duplicate entries in a given timeframe?

My table looks like this: +-----------+ | id | <- primary key | time | <- DateTime | row2 | <- varchar | row3 | | ... | +-----------+ I want to remove all ...
1
vote
1answer
138 views

Simple Slow Query Not Using Indexes

I have a slow query running on a large forum. The EXPLAIN synopsis: mysql> EXPLAIN SELECT COUNT(post_thanks.id) as thanked, post_thanks.postid, post.title, post.dateline FROM ...
6
votes
2answers
1k views

SQL ANSI JOIN precedence

I have a query that looks like this: SELECT * FROM TBLA A LEFT JOIN TBLB B ON A.Col1 = B.Col2 RIGHT JOIN TBLC C ON B.Col3 = C.Col4 JOIN TBLD D ON C.Col5 = D.Col6 In which order ...
2
votes
1answer
2k views

MySql: #1221 - Incorrect usage of UNION and ORDER BY

I have the following query which is intended to retrieve the newest 3 comments for each post in an array of posts. SELECT * FROM comment AS tbl WHERE sscm_id IN ( SELECT sscm_id FROM comment AS t1 ...
3
votes
3answers
2k views

Empty LONGTEXT or NULL?

In my MySQL DB I have one field called html_contents that contains all the html to be shown in a webpage. Obviously the html could be huge, and certaintly bigger than 64KB, therefore I decided to use ...
3
votes
4answers
6k views

Mysql innoDB write operations are extremely slow

I'm having serious performance problems with MySQL and the InnoDB engine. Even the simplest table makes writing operations (creating the table, inserting, updating and deleting) horribly slow, as you ...
0
votes
1answer
433 views

MySQL non-sequential primary key of certain length

what's the best way to create a non-sequential primary key of a certain length in MySQL? I'm looking to use the primary key as a 'Pin' number which real actual human people can use to refer to the ...
1
vote
2answers
4k views

How to analyse innodb status on deadlock in insert Query?

I have a dead lock which i have posted here. I managed to get the innodb status from my server. Here is the Innodb status. OS WAIT ARRAY INFO: reservation count 247864, signal count 247470 Mutex ...
4
votes
4answers
2k views

TRUNCATE TABLE statement sometimes hangs

Why does the TRUNCATE TABLE statement hang sometimes? What are the reasons for this type of issue? I am migrating from MySQL to MariaDB. This problem doesn't happen with MySQL, only with MariaDB. ...
3
votes
2answers
208 views

Choosing between MyISAM & InnoDB - two servers with related tables

I don't want to make a mistake. I am about to put my website online and I admit I haven't thought about which MySQL engine to choose: MyISAM or InnoDB. I read here and there that InnoDB should be ...
3
votes
2answers
111 views

How to search with partitions in my query?

Table structure: mysql> show create table transaction_event_items\G *************************** 1. row *************************** Table: transaction_event_items Create Table: CREATE TABLE ...
1
vote
0answers
105 views

MS SQL to MySQL Conversion

Is there a tool available that converts queries written as triggers, stored procedures and functions written in MS SQL 2008 to MySql? We switched databases and now I need to rewrite a bunch of queries ...
1
vote
1answer
2k views

Retrieve double data type value in non exponential form

Is it possible to retrieve non-exponential value in double data type column? After the width of the column is increased to 15 it shows the values in exponential form. Now I get the following: ...
1
vote
0answers
877 views

MySQL: Writing log entries from stored procedure

Is there a standard way to write log messages in MySQL stored procedures? I can write log messages to a designated log table, but I prefer the standard log mechanism where each message is coupled ...
1
vote
3answers
2k views

How to grant multiple users privileges; MySQL

I have the following code: GRANT SELECT,INSERT,UPDATE ON db1.* TO ‘user’@example.com; I am a beginner in mySQL, I was wondering if there is a method in which I can specific the privileges for every ...
0
votes
1answer
37 views

Mysql database connector table or keys

This may be a simple a question but I just wanted to clarify, at work I have a table containing a list of titles and I also have a list of authors in two different tables. What would be best way to ...
7
votes
1answer
8k views

Struggling to debug high CPU usage on Amazon RDS MySQL instance

We're running an m1.xlarge MySQL RDS server and having some issues with high CPU usage. We had some problems a couple of weeks ago with CPU utilization reaching 100% on a large instance. When we ...
6
votes
3answers
1k views

InnoDB Master-Master replication goes inconsistant after power failure tests

Afternoon gents, I'm currently stress testing a Master-Master replication setup using InnoDB as database engine. We're using this simple script for testing which we run in Linux CLI from a remote ...
2
votes
1answer
228 views

innobackupex is failing while exporting backup

I am using perl script which is working fine in one of my other box which used to take individual schema backups & finally take all schema together using percona innobackupex. I have following ...
5
votes
1answer
486 views

Installing and enabling both master and slave semisynchronous plugins on same server

I want to run a semisynchronous replication setup, and for simplicity I'd like to not have to INSTALL and UNINSTALL plugins when a slave is promoted to a master. So I'm wondering if I'll experience ...
0
votes
2answers
218 views

MySQL: SELECT the n-th item from an ordered result

SELECTing the top n elements from a table is easy: SELECT id FROM pixels WHERE pixel_id='some_pixel_id' ORDER BY id DESC LIMIT 1000; Finding the n-th element with a subquery is quite ...
6
votes
1answer
2k views

MySQL table creation insanely slow

A simple table creation on one of my MySQL databases takes forever: mysql> CREATE TABLE blah (id BIGINT UNSIGNED NOT NULL PRIMARY KEY); Query OK, 0 rows affected (16.58 sec) The machine is quite ...
0
votes
1answer
49 views

How to summarize Bridge results?

I am trying to summarize Bridge results for each pair (north/south pair and east/west pair). Match points for pair north/south is MPNS, for pair east/west is MPEW. Is there a way to summarize all ...
1
vote
2answers
302 views

Mix of Cyclic and Chained MySQL replication - What do you do with “log-slave-updates”..?

I have the following MySQL replication topology set up: Master1 (M1) replicates to Master2 (M2) Master2 (M2) replicates to Master1 (M1) Master1 (M1) replicates to Slave1 (S1) Pictorial View ...