MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

3
votes
1answer
2k views

Why does MySQL use all of memory and goes into swap when doing lots of delayed inserts?

We have a database server running Centos 5.6 64bit 64Gb of RAM. The server is idle most of the time. However, every hour it gets a lot of DELAYED inserts. Up to 3 mil INSERTs per hour into a MyISAM ...
1
vote
1answer
197 views

Normalization, field types and relationship

The following table is part of my project. I'm really strict about field types and store engines. I've read a lot of questions from this site, but I think there are a lot to do in the first step. Is ...
2
votes
2answers
506 views

Any problem will all InnoDB and one MyISAM table?

I have a MySQL 5.5 DB with all InnoDB tables. For some reason, one of the developers decided to create a MyISAM table. It is a log table for user sessions. I don't see why we should mix in a MyISAM ...
4
votes
2answers
369 views

Binlog - 'Race-like' Condition on Replication

I have a typical master-slave MySQL setup. Slave is in test mode currently. Master is heavily used. I am noticing something that looks like a potential race-like condition on the slave. On occasion, ...
6
votes
1answer
1k views

Using FORCE INDEX

I was in a presentation recently given by a Facebook MySQL engineer and he mentioned there that using FORCE INDEX reduces I/O. It was something to do with the MySQL Query Optimizer not needing to go ...
5
votes
3answers
4k views

Why does this Entity Framework query perform so bad in MySQL?

Let me give you a little setup. We have a InnoDB table on MySQL 5.1 with close to 20 million records, no foreign keys, and proper indexes for queries we do. We are using the latest 6.3.5 MySQL ...
2
votes
3answers
3k views

Sorting by DATETIME slower than by TIMESTAMP?

I have the a DATETIME key on which I sort the results and the query is running quite slow. Will it run faster if I change it to TIMESTAMP ? Because I noticed that ordering by numbered keys is done ...
1
vote
2answers
318 views

MySQL statement in Project Voldemort site

I've just entered Project Voldemort (a NoSQL key-value datastore) site, and saw something interesting: "Unlike MySQL replication, both reads and writes scale horizontally" Well, seems like ...
5
votes
1answer
3k views

Whats the difference between Transaction logs and Binary logs?

Coming from a SQL Server shop, I now work with MySQL and I was curious. What are the differences between MySQL's binary log and MSSQL's transaction log? By the outlook thus far, it seems that there ...
13
votes
1answer
22k views

How long is “too long” for MySQL Connections to sleep?

I logged onto my server to check the status of the database and noticed on the SHOW PROCESSLIST; that there are a large number of connections sleeping that are very old. What duration should the ...
1
vote
2answers
3k views

How do you encrypt data while performing a mysqldump?

My OS is windows 7. How can I encrypt data while performing a mysqldump? From the command prompt, can I take a mysqldump with encrypted varchar and texts values? Please help me. Thanks
2
votes
4answers
2k views

Connect to a remote MySQL Server from a dynamic IP address

My ISP at home uses a dynamic IP address. I'm trying to access a MySQL database at work. How can I connect to it (using MySQL Workbench)? I could grant all privileges to % so that any IP address will ...
1
vote
1answer
3k views

Sudden MySQL error: Unable to connect to any of the MySQL Hosts

I am using MySQL Community Server 5.5.18 on Windows 7. My application was running absolutely fine without any troubles but since morning it is giving strange messages while opening reports. Reports ...
1
vote
2answers
829 views

MySQL Community Edition: Can I replicate my entire server with another server in one go?

I need to migrate all the databases from one server to another. There are about 100 databases, and all databases are used daily and updated/inserted too and read through their respective websites. ...
6
votes
1answer
2k views

MySQL or Oracle Associate Certification?

I have 15+ years in software development and 7+ in web development, and I want to get a certification in another area, like DBA. I have 7+ years of experience like MySQL developer. Which is better for ...
3
votes
1answer
370 views

How can I get MySQL to use the value returned by a function as a default?

I have a pre-existing table that has a column to that can hold a UUID. I'd like to be able to define a default such that new rows coming in (from legacy systems) will still get a UUID defined, via ...
2
votes
3answers
1k views

How do I get % progress for “type db.sql | mysql”

I am doing: type db.sql | mysql and the console output is nothing. I see the ibdata1 file growing, but I don't know how many GB it will grow to. I would like to see a % progress indicator of some ...
1
vote
1answer
160 views

setting up a local database to be updated from a master database

I'm looking for an efficient way to keep multiple databases (on different servers) sync with a master database (also on a different server). Mind you I only need a one way sync (from master to all ...
1
vote
1answer
204 views

How to keep MySQL general_log after I restart my computer?

I use a statement set global general_log = 'ON' to enable the general_log on my computer. After I restart or shutdown it, I have to run the statement again. How can I config MySQL write general log ...
3
votes
1answer
577 views

Do I have duplicate key indexes?

CREATE TABLE relations ( object_id BIGINT(20) NOT NULL PRIMARY KEY, object_term BIGINT(20) NOT NULL, UNIQUE KEY link(object_id, object_term), CONSTRAINT fk_term FOREIGN KEY(object_term) ...
10
votes
2answers
5k views

MySQL Sharding vs MySQL Cluster

Considering performance only, can a MySQL Cluster beat a custom data sharding MySQL solution? sharding = horizontal partitioning When I refer to sharding, I'm considering sharding made in the ...
5
votes
3answers
4k views

MySQL general query log performance effects

One of our customers who has a somewhat problematic web application would like us to log all the queries for a period of 24 hours. I wouldn't know how much data it will actually write. The amount ...
1
vote
1answer
90 views

mysql server password change while restoring

I restored all database backup from another server's dumpfile to my machine. At the end my mysql server's password changed to that mysql server's password. Why it got overwritten? What i need to do to ...
1
vote
2answers
252 views

Is it advisable to have MySQL Master/Slave running on the same physical server, on the same mysqld, sharing the same disk?

my Use-Case : The solution I am developing is very data oriented. I run a cron job every 3 hrs to read lots of records from a file, process them and store them in the database. I also need to ...
7
votes
5answers
13k views

MySQL : DROP TABLE Starting with a Prefix

EXAMPLE : I have more than 30 tables starting with a prefix "dp_" and about 12 starting with "ex_". QUESTION : How can I drop all tables starting "dp_" in one query ?
2
votes
2answers
5k views

Does MySQL support replicating all databases?

I’ve been doing some investigation into properly configuring MySQL replication. From what I understand after reading the documentation, you can only replicate specific databases, and each database ...
4
votes
4answers
726 views

What's the equivalent of --safe-updates of mysql in MS SQL Server?

In MySQL, you can use the feature called --safe-updates (--i-am-a-dummy) to limit the number of rows updated per query. http://dev.mysql.com/doc/refman/5.0/en/mysql-tips.html#safe-updates Is there ...
4
votes
3answers
575 views

Separate databases for front-end and back-end

The site I am working on has a lot of backend/cron activity, so there are between 5 and 15 queries being executed every second of the day. This can slow down page loads by a second or more. I was ...
6
votes
3answers
461 views

Is there a need to keep refreshing the indexes from time-to-time?

This question is common for all the database products I use, viz. SQL Server, MySQL, Oracle and PostgreSQL. I have created a fresh database and the tables, at present, have no records. I have created ...
3
votes
1answer
1k views

Master and Slave having same id's

I am working as a remote DBA for some of the production servers. There was replication from Master to Slave. There is something changed in the scenario they have made one of the Slaves as master ...
4
votes
2answers
3k views

Incremental backups using MySQL Workbench

I need to start doing regular backups of my databases, and I'd like them to be incremental; that is, only backing up the tables that have been changed. I use MySQL Workbench, and I've used the export ...
2
votes
1answer
165 views

How can I best combine “get categories” and “has user access”?

I was wondering if it's possible to create a query for the following problem. I only want to select categories from the (MySQL) database (if the user has access). A user has multiple roles; A ...
1
vote
2answers
172 views

Two master databases for two separate apps

We have two different websites one is hosted in asia datacenter called it asiadata.com and other site is hosted in europe datacenter called it europedata.com. Currently we have only one master ...
5
votes
4answers
2k views

Incomplete mysqldump

I'm trying to run mysqldump to create a database snapshot, and I'm finding it will randomly stop midway, without reporting any error. My database is relatively small (about 100MB) and is using InnoDB. ...
6
votes
3answers
6k views

ALTER TABLE on a large table with an indexed column

I have a large table with a VARCHAR(20) column, and I need to modify that to become a VARCHAR(50) column. Typically, performing an ALTER TABLE (adding a TINYINT) on this particular table takes about ...
2
votes
1answer
2k views

Migration from DB2 to MySQL

Does any one have experience on migration from DB2 to MySQL ? Please share with me. I tried googling, but I have not received much information on this.
3
votes
2answers
654 views

Should I move to InnoDB during a planned migration?

I'm shortly migrating a Debian Lenny webserver to another host and Debian Squeeze. The standard MySQL installation even on Squeeze is 5.1 and therefore would default to MyISAM - I'm inclined to stick ...
1
vote
1answer
333 views

Why did the MySQL Storage Engine Change on Restore in one scenario?

In my production database life, there was one tragic incident when the MySQL engine type was accidentally changed from InnoDB to MyISAM on restoring a recent backup. The result was that all ...
1
vote
1answer
955 views

Problem with MySQL Master/Slave reboot when in replication

There is a master and number of slaves connected to it. Due to some patches, we have to Reboot the Master and Slave. Afterwards, we have to make sure replication is running fine. While doing this ...
1
vote
1answer
88 views

What is QP layer?

From blogs.innodb.com: InnoDB Memcached with Binlog Capability In our earlier Labs release, we presented a MySQL NoSQL solution through InnoDB Memcached Daemon Plugin (see earlier Calvin’s and my ...
3
votes
2answers
2k views

Different MySQL Datafile Sizes After Restoration

I'm quite new in database administration. The database architecture of my current company is master-slave replication. We are using MySQL version 5.0.86. Some weeks ago, we upgraded the company's ...
2
votes
2answers
360 views

Database Transfer from PostgreSQL to MySQL

Is there any method to tranfer the data and schema from a postgresql database to mysql?
1
vote
1answer
294 views

MySQL Grant Permission

I want to Grant a user only INSERT permission. When I try to insert data, it throws the error "Access Denied". What permission do I give a user to use/select database in mysql and how? I have given ...
3
votes
1answer
90 views

Is it possible to find the values of MySQL variables if I do not have SELECT privileges on mysql.user?

I am getting a 'msyql server has gone away' error sometimes when doing a large binary insert, so I wanted to check the settings on mysql, things like wait_timeout and max_allowed_packet. However show ...
2
votes
1answer
617 views

BACKUP and RESTORE MySQL Database

I have very specific question. I have seen the instructions on how to backup and restore mysql database using SSH but they barely explain the process when backing up on one server and restoring on ...
1
vote
2answers
6k views

Set up a MySQL slave using mysqldump to get the initial data

I have a master database which already has some data in it. The tables in the master database include both MyISAM and InnoDB engines. Now I want use mysqldump to dump the initial data of my slave ...
3
votes
1answer
3k views

What memory should be given to the variables of my.cnf ?

Installing a MySQL server is quite easy. However, after installing, configuring the server is an important task for a DBA. Having 2GB of RAM and 250GB of disk space, how should I tune MySQL server so ...
3
votes
1answer
712 views

Webapp & MySQL: Row Level Security

I am trying to emulate row level security on a webapp I am developing using MySQL. Using this method: Creating a database with the the required tables where the data pertaining to all the users will ...
1
vote
1answer
198 views

What is a better way to keep “user online”?

I'm working on software for social network and I plan it to scale a lot. Actually, I'm updating timestamp column every time user clicks, to be sure they're marked as online. When they do not click for ...
4
votes
2answers
765 views

MySQL - Changing DB CHARACTER SET

I have a 30GB MySql DB, made of innoDB tables. currently the tables character set is: "utf8_unicode_ci" and I want to change it to "utf8_general_ci", what the best way to do it? currently i'm going ...