FromDual TechFeed (en)
Privileges of MySQL backup user for mysqldump
Some MySQL customers do not want to use the root user for mysqldump backups. For this user you have to grant the following minimal MySQL privileges:
mysqldump --single-transaction (InnoDB)
CREATE USER 'backup'@'localhost' IDENTIFIED BY 'secret';
GRANT SELECT, SHOW VIEW, RELOAD, REPLICATION CLIENT, EVENT, TRIGGER ON *.* TO 'backup'@'localhost';
mysqldump --lock-all-tables (MyISAM)
GRANT LOCK TABLES ON *.* TO 'backup'@'localhost';
If we missed a privilege please let us know.
Taxonomy upgrade extras: Restore Recovery Backup Mysqldump
Shrinking InnoDB system tablespace file ibdata1 PoC
In this weeks MySQL workshop we were discussing, beside other things, about the innodb_file_per_table parameter and its advantages of enabling it. In addition there was a discussion if the InnoDB system tablespace file can be shrinked once it has been grown very large or not. We all know the answer: The InnoDB system tablespace file does never shrink again.
But why should it not be possible? Other databases like for example Oracle can shrink or even get rid of tablespace files… After some …
Taxonomy upgrade extras: Innodb Tablespace Ibdata1 Innochecksum
Last login of MySQL database users
MySQL hosting providers can easily loose the overview over their customers and which user or schema is still in use and which not.
The MySQL database becomes bigger and bigger, uses more and more RAM and disk space and the backup takes longer and longer.
In this situation it would be nice to know which MySQL database user has logged in within the last 6 months for example. MySQL database users who did not login within a defined period can be backuped and removed from the production MySQL database.
The …
Taxonomy upgrade extras: User Login Trigger Logon Trigger Logging Audit Hoster Hosting Sql/Psm
MySQL backup to file, gzip and load in one step
When a MySQL Slave is set-up with mysqldump you have 2 possibilities:
- You dump into a file and then load the data into the Slave with the
mysqlclient utility. - You dump directly into the
mysqlclient utility.
The first possibility has the advantage that you can start the load again if it failed. You can look into the file (and do some changes if needed).
The second possibility has the advantage that you do not need disk space and that it is possibly faster. But when the load fails you have to start from …
Taxonomy upgrade extras: Backup Compress
Resize XFS file system for MySQL
Important: Before you start any operation mentioned below do a proper file system backup of your XFS file system you want to resize. If MySQL is running on this mount point do this with a stopped mysqld. Alternatively you can also use mysqldump to do the MySQL backup but test the restore time before continuing to not experience ugly surprises…
All these operations have to be performed as the root user. First we want to see what mount points are available:
shell> df -h
Filesystem Size …Taxonomy upgrade extras: Xfs File System
MySQL tmpdir on RAM-disk
MySQL temporary tables are created either in memory (as MEMORY tables) or on disk (as MyISAM tables). How many tables went to disk and how many tables went to memory you can find with:
mysql> SHOW GLOBAL STATUS LIKE 'Created_tmp%tables';
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Created_tmp_disk_tables | 49094 |
| Created_tmp_tables | 37842181 |
+-------------------------+----------+
Tables created in memory are …
Taxonomy upgrade extras: Temporary Memory Table Myisam Temporary Table Tmpdir
Galera Cluster Nagios Plugin
Based on customer feedback we have decided to add a plugin Galera Cluster for MySQL to our MySQL Nagios/Icinga Plugins.
The module checks, if the node is in status Primary and if the expected amount of Galera Cluster nodes is available. If not, a warning or an alarm is returned.
The script is written in Perl and is Nagios Plugin API v3.0 compatible.
You can download it from our download page.
If you have suggestions for improvements, please contact us. Bugs can be reported at our bugs database.
The …
Taxonomy upgrade extras: Monitoring Galera Plugin Cluster Nagios
Galera Cluster discussions at FrOSCon 2012
During and after Henriks great talk about Galera Cluster at the FrOSCon 2012 in St. Augustin we found 2 important things related to Galera Cluster for MySQL:
- The InnoDB double write buffer (
innodb_doublewrite) should not be disabled anymore for Galera when using v2.0 and higher!!! The reason for this is: When MySQL crashes InnoDB pages might get corrupted during the crash. They would be fixed by the blocks from the double write buffer during auto-recovery. But if the double write buffer is disabled they …
Taxonomy upgrade extras: Galera Cluster Mysql Cluster Channel Failover Replication
Deadlocks, indexing and Primary Key's
Recently a customer has shown up with some deadlocks occurring frequently. They were of the following type (I have shortened the output a bit):
*** (1) TRANSACTION:
TRANSACTION 22723019234, fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 7 lock struct(s), heap size 1216, 14 row lock(s)
update location set expires='2012-08-10 04:50:29' where username='12345678901' AND contact='sip:12345678901@192.168.0.191:5060' AND callid='945a20d4-8945dcb5-15511d3e@192.168.0.191'
*** (1) WAITING FOR THIS LOCK TO …Taxonomy upgrade extras: Index Primary Key Innodb Tuning Performance Optimizer Deadlock
SchoonerSQL
There is a product out in the wild which is called SchoonerSQL
[ 1
] from an American company called Schooner Information Technology
[ 2
]. They claim to have top-performance
[ 3
] and high-availability features with up 99.999% availability
[ 1
].
The technology seems to be based on InnoDB, SSD and some kind of replication with failover mechanism.
Unfortunately this product is neither open source nor is it really transparent what they are doing. Which is quite suspicious… Because this lack of …
Taxonomy upgrade extras: Schooner Replication High Availability
Change MyISAM tables to InnoDB and handle SELECT COUNT(*) situation
Its a known problem that changing the Storage Engine from MyISAM to InnoDB can cause some problems
[ 1
] if you have queries of this type:
SELECT COUNT(*) from table;
Luckily this query happens rarely and if, the query can be easily omitted or worked around by guesstimating the amount of rows in the table. For example with:
SHOW TABLE STATUS LIKE 'test';
But in some rare cases customer really needs these values for some reasons. To not exhaust the resources of the server with this query which can be fired …
Taxonomy upgrade extras: Innodb Materialized Views Materialised Views Myisam Select Shadow Table Count
MySQL @ FrOSCon 7 in St. Augustin (Germany)
Also this year we will have a special track for MySQL, Galera, Percona und MariaDB at the FrOSCon in St. Augustin in Germany. The conference is scheduled for August 25 and 26 2012.
Together with the PostgreSQL people we are organizing a sub-conference for Open Source RDBMS there. Now we are looking for interesting talks about MySQL and related techniques like Galera, Percona, MariaDB. The only restriction for the talks is: They must be about an Open Source topic.
We encourage you to send your proposals. …
Taxonomy upgrade extras: Mysql Talk Conference Froscon
How to make the MySQL Performance Monitor work on Windows?
MySQL and Galera Load Balancer (GLB)
Table of Contents
- Building the Galera Load Balancer
- Starting the Galera Load Balancer
- Querying the Galera Load Balancer
- Draining nodes with Galera Load Balancer
- Removing nodes from and adding nodes to Galera Load Balancer
When you install a Galera Cluster for MySQL for High Availability (HA) it is not enough to install the Database Cluster to achieve this goal. You also have to make the application aware of this HA functionality. This is typically done with some kind of load balancing mechanism between …
Taxonomy upgrade extras: Galera Glb Load Balancer
Troubles with MySQL 5.5 on FreeBSD 9
FreeBSD 9 seems to have some troubles with MySQL 5.5.20. A customer has moved from MySQL 5.0 on Linux to MySQL 5.5 on FreeBSD 9. He experienced a lot of periodic slow downs on the new, much stronger, system which he has not seen on the old Linux box.
This slow downs were also shown in high CPU system time but we could not see any I/O going on.
When we looked into MySQL we have seen many threads in Opening tables state in the MySQL processlist.
The first idea was to increase table_open_cache to 2048 and …
Taxonomy upgrade extras: Mysql Table Temporary Table_open_cache Freebsd
Does InnoDB data compression help with short disk space?
Because we are a bit short off disk space on one of our servers I had the idea to try out the MySQL feature Data Compression for InnoDB. This feature is useful if you have tables with VARCHAR, BLOB or TEXT attributes.
To not make it not too simple our table is partitioned as well. Our table looks like this:
CREATE TABLE `history_str` (
`itemid` mediumint(8) unsigned NOT NULL DEFAULT '0',
`clock` int(11) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY …Taxonomy upgrade extras: Innodb Compress
What can MySQL performance monitoring graphs tell you?
Many of you may monitor their databases for different purposes. Beside alerting it is often good to also make some graphs from MySQL performance counters to see what is actually happening on your database.
The following graphs where made with our FromDual Performance Monitor for MySQL as a Service (MaaS) set-up. If you do not have the time to install a performance monitoring yourself please feel free to contact us for our MaaS solution.
Overview
First of all it is a good idea to have an overview of all the …
Taxonomy upgrade extras: Performance Tuning Performance Enterprise Monitor Monitoring Monitor Performance Monitoring Performance Monitor Graph Mpm Maas
I prefer MySQL binary tar balls with Galera...
In my set-ups I have different MySQL versions (MySQL 5.0, 5.1, 5.5 and 5.6, Percona Server 13.1 and 24.0, MariaDB 5.2.10, 5.3.3, Galera 1.0, 1.1 and 2.0) running in parallel at the same time.
Up to now I have not found a practical way yet to do this with RPM or DEB packages. If anybody knows how to do it I am happy to hear about it.
So I love and need only binary tar balls. Installation and removal is done within seconds and no remainings are left over after a removal. To operate the whole I use myenv.
Some …
Taxonomy upgrade extras: Installation Tar Galera Binary
Recover lost .frm files for InnoDB tables
Recently I found in a forum the following request for help:
My MySQL instance crashed because of free disk space fault. I saw in /var/lib/mysql all the files: ibdata1, ib_logfile* and all the folders containing frm files. Well, when i solved the problem and run successfully the instance, some databases disappeared. One of those is the most important, and i don’t know how many tables had and their structures. Is there any way for recover the entire lost database (structure and data) only having the …
Taxonomy upgrade extras: English Restore Backup Recovery Innodb Frm Innodb Table Monitor Ibdata1
Rolling upgrade of Galera 1.0 to 1.1
A few days ago Codership announced their new version Galera v1.1 - synchronous Replication Cluster for MySQL. Before we look at the new feature of Rolling Online Schema Upgrade (OSU) we have a look at how to upgrade to the new Galera release.
A rolling upgrade of your synchronous Galera Replication Cluster from version 1.0 to 1.1 is quite easy when you stay at the same MySQL version (5.5).
To not lose the availability of your database service during the upgrade you should have at least 3 Galera nodes in …
Taxonomy upgrade extras: English Upgrade Galera Rolling Upgrade

