MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
1answer
591 views

MySql: Change from latin1 to utf8

Today my database character set and collation is set to latin1. All of the tables in the database are however already set to DEFAULT CHARSET=utf8 and all data is utf8. Is if it is safe to change ...
5
votes
1answer
4k views

What are the primary differences between NuoDB and MySQL?

Since NuoDB can be used as a storage engine for MySQL, what are the primary differences between using the NuoDB as a server and using MySQL as the server? In addition, recently I've received a ...
7
votes
3answers
3k views

What is the best approach to run a DELETE query on 92K of 4 million rows?

Options that have occurred to me: One big delete statement. For example: delete from x where (y = 'x' and x = 'y') or (y = 'a' and x = 'b') Same as above, but chunk in smaller pieces, 10k at a ...
2
votes
1answer
402 views

Does mysqlhotcopy block SELECT statements from different clients?

I would like to create a backup of different MyISAM tables on a server using mysqlhotcopy. These tables are about 6GB in size. I would like to know, does mysqlhotcopy block users from SELECTing ...
17
votes
5answers
16k views

MySQL IS NULL / IS NOT NULL Misbehaving?

Please have look at this table: mysql> desc s_p; +-------------------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | ...
6
votes
2answers
5k views

Ibdata usage and Recommendations?

I have a Production server On November 5,2011 the ibdata size was 100G. In Approximate 3 months it is increased to 200G.So it has just doubled its size.So it is a Huge Data.Currently lvm is 251G. I ...
2
votes
1answer
3k views

MariaDB XtraDB Performance Tuning

I believe that innodb has a single read thread. However, with MariaDB you can set multiple read threads. I'm unsure what the recommended value would be. Questions Does anyone have any experience ...
2
votes
2answers
2k views

Limit WHERE to MAX() & COUNT()

This is my current mySQL query: SELECT e.*, MAX(m.datetime) AS unread_last, COUNT(m.id) AS unread FROM TAB_EVENT e LEFT JOIN TAB_MESSAGE m ON e.id=m.event_id WHERE ( m.`read` IS NULL OR ...
3
votes
1answer
2k views

Any disadvantages to enabling federated storage engine?

We've encountered a couple use cases where having federated tables prove useful, despite their limitations and caveats. As best I can tell this must be enabled with a federated declaration in the ...
1
vote
1answer
148 views

Mysql database design with XML

I intend to create a wiki webpage, but it has some few more limitations than regular wikis. The content is completely user-editable, but the structure of the page is determined previously. To make ...
1
vote
2answers
3k views

Usage of RESTRICT or No ACTION in FOREIGN KEY Constraints

Sorry if this question is naive, but I was unable to understand possible usage of RESTRICT or No ACTION. Consider a simple database of CREATE TABLE column1 ( first_id int(11) NOT NULL AUTO_INCREMENT, ...
5
votes
1answer
5k views

How should I interpret the “lock time” within mysql slow query log?

I'm trying to understand how to best interpret the lock time for the queries which show up on our MySQL slow query log. For instance if an UPDATE query has 10 second lock time. I presume it is the ...
1
vote
3answers
586 views

GRANT command not working in MySQL Server

I'm trying to execute the below command as root user to provide accessiblity from my application. GRANT ALL ON communitycourts.* TO 'root'@'%' WITH GRANT OPTION; But it returns 0 rows affected, but ...
2
votes
1answer
237 views

'packet too large' error with packet smaller than max_allowed_packet

Some time ago we started storing serialized data in our MySQL database and immediately ran into the well known 'packet too large' error. We increased max_allowed_packet to 64M and all was well. This ...
4
votes
2answers
572 views

Multi-threaded replay of master activity for load/performance testing

Does anyone know of any existing tools/products that accomplish what I'm trying to do? After searching around for a bit the only thing I could find surrounding what I'm trying to accomplish is ...
4
votes
1answer
221 views

Need to find duplicate entries

I received a database with a few million records in it, but apperently there might be duplicate records in them. A user enters data into the database and a primary key is generated, however if the ...
2
votes
1answer
664 views

How to serialize a record / row in SQL?

Is there a way to serialize a record/row in SQL? And conversely, to deserialize something that has been serialized. By serialize, I mean put all of the fields in a record into one field or string. ...
6
votes
1answer
729 views

Loyalty reward - record for every day of a week

I have a table that contains every login a user makes. I am trying to make a loyalty system that rewards users if they've logged in every day for a week. So, the real question, how do I get every ...
1
vote
1answer
2k views

SQLSTATE[HY000]: General error: 1025 Error on rename of

I'm getting this error: SQLSTATE[HY000]: General error: 1025 Error on rename of './salt/ghost' to './salt/#sql2-4ab-630b' (errno: 152). Failing Query: "ALTER TABLE ghost DROP FOREIGN KEY ...
3
votes
1answer
286 views

Does MVC architecture design pattern effect MySQL database performance?

Our current site is entirely developed in the cakePHP framework with the MVC architecture. If we notice more than around 19-20 users viewing the site at once, it begins to crawl to a hault and begin ...
1
vote
1answer
81 views

Design for a Testing system

I want to redesign a part of my system. I got the following objects: Site: id Name Site Version: id idSite Name Task: id idSite Name Test: id idTask Name TestResult: idTest idSiteVersion ...
3
votes
1answer
3k views

How do I update a table with the aggregted values (min, max) of a related table, fast?

I have a table create table w ( id integer primary key, -- min_xyz double, max_xyz double, min_abc double, max_abc double ); with the min* and max* values currently being null. I have ...
1
vote
3answers
3k views

How to change data location on Ubuntu

I already saw this question here: change mysql data directory but it's not very helpful. What I want - to move my sql data folder to my different place (/media/data) What I did: a) sudo service ...
4
votes
1answer
281 views

Type safety in WHERE clauses

I've spent the most part of yesterday tracking down a strange bug in our PHP/MySQL application and the culprit seems to be a poor query. We have a table like ...
4
votes
1answer
1k views

How to UPDATE just one record in DB2?

In DB2, I need to do a SELECT FROM UPDATE, to put an update + select in a single transaction. But I need to make sure to update only one record per transaction. Familiar with the LIMIT clause from ...
4
votes
3answers
5k views

What is the mysql.db table used for?

Related to my MySQL issue I have a user with USAGE grant in mysql.user, but in mysql.db this user has Select, Insert, Update, Delete. Thus the user can successfully query the database. I can't find ...
5
votes
2answers
652 views

Unexpected extremely long query time (~5 minutes using nested WHEN-INs)

For the first time, I am running up against a horrifically long execution time of a MySQL query (~5 minutes). The data in the database is highly (and not arbitrarily) normalized. It very efficient ...
3
votes
2answers
2k views

MySQL replication to slave having VPN connection to Master

I am setting up an environment in which the Master and Slave are on different networks at different physical locations (both run on MySQL 5.5.20). I have set up a VPN connection from slave's network ...
4
votes
1answer
7k views

SQL command to remove prefix from a set of tables

I am no DBA. I have a situation with a MySQL database (5.0.51a) where I want to remove a 'dr_' prefix to all tables having this prefix (about 110 tables). I could rename them one by one of course, but ...
4
votes
1answer
2k views

Is there a way to find my.cnf in shared hosting?

I'm curious is there a way to find my.cnf in shared hosting or is this file can be configured just by DBAs and no one can set his/her own settings?
2
votes
1answer
1k views

Is it possible to convert a .mysql file to a .sql file?

I am facing an issue with a MySql dump file (i.e mydump.mysql) generated by a Drupal export module. I am trying to import it on a local Drupal installation via Acquia Dev Desktop. When browsing for ...
14
votes
4answers
21k views

How do you identify InnoDB table corruption?

I have some tables that are partitioned and have several indexes on a replicated slave. After copying the snap shot (verified safe) to a new slave and upgrading mysqld from 5.1.42 to 5.5.15 and ...
6
votes
2answers
2k views

How to implement soft deletes?

What is your method of implementing soft deletes in a database? Ideally the solution would allow for decent performance on large tables take relationships into account take unique keys into account ...
11
votes
3answers
13k views

MySQL table_cache and Opened_tables

I have seen people use the comparison of Open_tables and Opened_tables to assess whether the table_cache is too small in MySQL. However, I believe that Opened_tables is cumulative across uptime, so ...
9
votes
3answers
2k views

MySQL High Performance for Lots of SELECTs/INSERTs/UPDATEs/DELETEs

I am creating a module where every user often gets a record into a table for 10 to 300 seconds. When the time expires a record gets deleted. The case is: there will be a lot of users and records will ...
7
votes
3answers
9k views

can't remove “GRANT USAGE”

I was testing some stuff, and added a: grant usage on statistics.* to cptnotsoawesome@localhost identified by 'password'; so now when I do show grants for cptnotsoawesome@localhost; I can see ...
5
votes
1answer
6k views

How to setup replication(Master/slave) in MySQL 5.5.20?

I have two servers both running on MySQL 5.5.20 and I want to setup replication, so every update/insert on Master would reflect immediately on Slave machine. I tried following this tutorial (I used ...
4
votes
2answers
2k views

MySQL replication: “Houston, We've Got a Problem”

I ran into a problem with our replication server. Essentially, we have 2 databases (database1 and database2). Master server has both. Slave has only database1. There is a Replicate_Do_DB: database1 ...
3
votes
2answers
2k views

How can I optimize performance on a MySQL ndbcluster?

So, this is what I have: A simple table classes__to_students: |class |student| --------------- Math Alice Math Bob Math Peter Math Anne Music Bob Music Chis Music ...
1
vote
1answer
1k views

Looking for a tool to convert between MySql, Sql Server CE, Sql Server and SQLite [closed]

Our old product supports 4 different database types for storing data: SQLite MySql Sql Server CE Sql Server There is also an export feature, which allows to export some data and here is the ...
2
votes
1answer
2k views

MySQL: What field types for large numbers?

I need to store some high numbers, some with decimal points (2 digits). 965.630,5 INT 47.320.500 INT -62.188,0 INT 32,8% FLOAT 225.165,7 DOUBLE 715.100,7 DOUBLE ...
6
votes
2answers
2k views

Why isn't mixed-mode replication default on MySQL

It is well known that mixed-mode replication was default from MySQL 5.1.12 to MySQL 5.1.28. However, this was reverted, and at the current moment, statement-based replication is default. In the ...
1
vote
1answer
160 views

Tick boxes and Dropdown

Have a look at the image below: This is "Plain Buger" item - customer can select sauces and extras with it. There are different sizes for Plain Burger. I need to translate this UI into database ...
2
votes
2answers
446 views

MySQL: Slow log; append CPU usage

I have the MySQL slow log feature enabled: http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html But sometimes the query_times are high simply due to high CPU load. How can I append the current ...
0
votes
1answer
368 views

MySql - Global index

I'm new to MySql partitioning and have a question regarding indexes. let say i have the following table: CREATE TABLE `members` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, ...
1
vote
1answer
219 views

Randomly generated password for mysql admin over time?

I have this idea of making my database's Admin account secured by creating the following: Trigger is activated every hour in mysql this trigger activates a stored procedure Stored procedure ...
8
votes
1answer
2k views

MySQL reads / writes per table

I am optimising our DB. Essentially I am trying to find the most written and the most read tables in our db. After that I will follow by sym-linking those tables into separate drives. Is there a way ...
1
vote
2answers
6k views

What would be the fastest approach to bulk update this mysql table (Innodb)?

I have a table with 100M rows. I am able update my table like 850 updates / minute. How to speed this up? I am using following approach: mysql -uroot < query_file where query_file contains 1M ...
2
votes
1answer
513 views

Programatically testing slave status - What fields in SHOW SLAVE STATUS indicated slave status is OK / in ERROR?

We use pingdom and a few internal heartbeat mechanisms on our product. We would like to add a 'are our slaves running and in good shape' check. What fields in SHOW SLAVE STATUS indicate that the ...
4
votes
1answer
870 views

Yum update mysql from 5.1 to 5.5

I was just in the process of 'yum updating' a server. One of the updates its suggesting to carry out is an upgrade from mysql 5.1 to 5.5. The mysql server operates in a master-master replication ...