Mysql

MariaDB or MySQL, that is the question

Many customers come to us and ask us whether to use MariaDB or MySQL. The answer is not so simple. FromDual is a neutral and vendor independent MariaDB/MySQL consulting company. So we should not have (in the meaning of neutral) a clear preference. For us internally we have chosen our strategy according to some clearly defined criteria. But what we have chosen for us is not necessarily the right choice for you.

So what we want to show you here is a tool which helps you to choose the right strategy for your …

tags: 

Databases are standardized but in detail they behave different

For a fancy application we want to query a chunk of rows from a table and therefore we need the minimum and the maximum of the Primary Key of these rows.
Because InnoDB is an Index Organized Table or Index Clustered Table we know that this access will use the Primary Key. But to be sure and to be compliant with the standard (and compatible) we use and ORDER BY on the Primary Key.

MySQL 5.7

First we create some test data:

mysql> CREATE TABLE t_my (
  ID CHAR(32) NOT NULL PRIMARY KEY
) ENGINE = InnoDB; …

Shutdown with MySQL 8

On StackExchange for Database Administrators I recently have seen a question which attracted my interest.

The question puzzled me a bit because the answer seems too easy. Further the question was not so clear. An all theses factors smell dangerous…

About time - was, is and will be

How can I find out if the database “was” shutdown slowly? This is quite easy: Look into your MySQL Error Log and there you will find a log sequence similar to the following:

2020-03-30T08:03:36.928017Z 0 …
tags: 

Migration from MySQL 5.7 to MariaDB 10.4

Up to version 5.5 MariaDB and MySQL can be considered as “the same” databases. The official wording at those times was “drop-in-replacement”. But now we are a few years later and times and features changed. Also the official wording has slightly changed to just “compatible”.
FromDual recommends that you consider MariaDB 10.3 and MySQL 8.0 as completely different database products (with some common roots) nowadays. Thus you should work and act accordingly.

Because more and …

MariaDB and MySQL consulting by plane

Since January 2019 FromDual tries to contribute actively a little bit against global warming too.

The best for the climate would be to NOT travel to the customer at all! For this cases we have our FromDual remote-DBA services for MariaDB and MySQL.

But sometimes customer wants or needs us on-site for our FromDual in-house trainings or our FromDual on-site consulting engagements. In these cases we try to travel by train. Travelling by train is after walking or travelling by bicycle the most climate friendly …

Upgrade MySQL 5.7 to MySQL 8.0

Early adopters of our customers are considering to upgrade to MySQL 8.0. To be prepared we have created a check-list:

  • RTFM: Upgrading MySQL. Really! This time is different than all the years before…
  • Upgrade Path:
    • Only Upgrade from 5.7 to 8.0 is supported (skipping 5.7 is NOT supported!). So Upgrade to 5.7 first!
    • Only Upgrade between GA releases (5.7.9+, 8.0.11+) is supported.
    • Recommended: Upgrade to newest 5.7 first (5.7.25).
  • Check for Incompatibility Changes, Deprecated and Removed Features: …
tags: 

Advanced MySQL Enterprise Training by FromDual

Due to the increasing demand FromDual has developed an Advanced MySQL Enterprise Training for DBAs and DevOps. After testing this training extensively with some selected customers last year we offer this MySQL Enterprise Training in 2018 for a broader audience.

The MySQL Enterprise Training addresses MySQL DBAs and DevOps which are already familiar with MySQL and approach now the challenge to operate a serious MySQL Enterprise infrastructure.

The topics of the 3 days MySQL Enterprise training you can find …

Oracle releases MySQL security vulnerability fixes 2018-01

As in every quarter of the year Oracle has released yesterday its recommendation for the MySQL security updates. This is called, in Oracle terminology, Critical Patch Update (CPU) Advisory.

This CPU is published for all Oracle products. But FromDual is only interested in MySQL related topics. So let us concentrate on those.

This time 25 fixes with a maximum score of 8.1 (out of 10.0) were published.

6 of theses 25 vulnerabilities are exploitable remotely over the network without authentication (no user …

First Docker steps with MySQL and MariaDB

The Docker version of the distributions are often quite old. On Ubuntu 16.04 for example:

shell> docker --version 
Docker version 1.13.1, build 092cba3

But the current docker version is 17.09.0-ce (2017-09-26). It seems like they have switched from the old version schema x.y.z to the new year.month.version version schema in February/March 2017.

Install Docker CE Repository

Add the Docker’s official PGP key:

shell> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK …

FromDual Performance Monitor for MySQL and MariaDB 1.0.1 has been released

FromDual has the pleasure to announce the release of the new version 1.0.1 of its popular Database Performance Monitor for MySQL, MariaDB, Galera Cluster and Percona Server fpmmm.

You can download fpmmm from here.

In the inconceivable case that you find a bug in the fpmmm please report it to our Bug-tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

This release contains various bug fixes.

Changes in fpmmm v1.0.1

fpmmm agent

  • Fpmmm suppresses …

Reset MySQL 5.7 password on macOS over the command line

This one is for all MySQL-DBA’s, which are working on macOS. Since the Apple OS has a rather peculiar way of starting and stopping MySQL, compared to Linux, you can run into some issues. These problems occur especially, if you have no access to the GUI.

Preparation

Put skip-grant-tables into the mysqld section of the my.cnf. A my.cnf can be found in /usr/local/mysql/support-files. You MUST work as root for all the following steps.

shell> sudo -s
shell> vi …
tags: 

Non-standard database set up with SELinux

What is SELinux?

The Security-Enhanced Linux is an extension to the Linux Kernel, made by the NSA (National Security Agency). It implements Mandatory Access Controls (MAC), which allow an administrator to define, how applications and users can access resources on a system.

There is more detail in the SELinux Wki: https://selinuxproject.org/page/FAQ
… and the CentOS documentation: https://wiki.centos.org/HowTos/SELinux

Some distributions have it installed by default, but not active, some have it …

MySQL and MariaDB variables inflation

MySQL is well known and widely spread because of its philosophy of Keep it Simple (KISS).

We recently had the discussion that with newer releases also MySQL and MariaDB relational databases becomes more and more complicated.

One indication for this trend is the number of MySQL server system variables and status variables.

In the following tables and graphs we compare the different releases since MySQL version 4.0:

mysql> SHOW GLOBAL VARIABLES;
mysql> SHOW GLOBAL VARIABLES LIKE 'innodb%';
mysql> …

New Features in MySQL and MariaDB

As you probably know MySQL is an Open Source product licensed under the GPL v2. The GPL grants you the right to not just read and understand the code of the product but also to use, modify AND redistribute the code as long as you follow the GPL rules.

This redistribution has happened in the past various times. But in the western hemisphere only 3 of these branches/forks of MySQL are of relevance for the majority of the MySQL users: Galera Cluster for MySQL, MariaDB (Server and Galera Cluster) and Percona …

FromDual Performance Monitor for MySQL and MariaDB 1.0.0 has been released

FromDual has the pleasure to announce the release of the new version 1.0.0 of its popular Database Performance Monitor for MySQL, MariaDB, Galera Cluster and Percona Server fpmmm.

You can download fpmmm from here.

In the inconceivable case that you find a bug in fpmmm please report it to our Bug-tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

This release contains various bug fixes and improvements. Further significant functionality has …

How to build your own RPM repository for MySQL Enterprise Server 5.7 on RHEL 7

Prepare the RPM repository server

Install the software to create a RPM repository server (on an Ubuntu web server):

shell> sudo apt-get install createrepo

Create the directory structures and initialize the repositories:

shell> sudo mkdir -p /var/www/html/repos/centos/7/os/x86_64
shell> sudo createrepo /var/www/html/repos/centos/7/os/x86_64/

Copy the MySQL Enterprise RPM packages to the repository:

shell> sudo cd /var/www/html/repos/centos/7/os/x86_64/
shell> sudo unzip -v …

How to Install MySQL Enterprise Server 5.7 on Red Hat Enterprise Linux 7

If you have already Red Hat Enterprise Linux 7 (RHEL 7) or CentOS 7 in use you probably found out, that it is not that easy to install MySQL Enterprise Server because there are already pre-installed MariaDB 5.5 libraries:

shell> yum localinstall mysql-commercial-client-5.7.16-1.1.el7.x86_64.rpm mysql-commercial-libs-5.7.16-1.1.el7.x86_64.rpm mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpm mysql-commercial-common-5.7.16-1.1.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining …

FromDual Performance Monitor for MySQL and MariaDB 0.10.6 has been released

FromDual has the pleasure to announce the release of the new version 0.10.6 of its popular Database Performance Monitor for MySQL, MariaDB, Galera Cluster and Percona Server fpmmm.

You can download fpmmm from here.

In the inconceivable case that you find a bug in fpmmm please report it to our Bug-tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

This release contains various bug fixes and improvements. The previous release had some major bugs …

Differences between MySQL and MariaDB

  • max_user_connections Can be changed online in MySQL. Cannot be changed in MariaDB if value was set to 0.
  • PERFORMANCE_SCHEMA is enabled in MySQL 5.6 and 5.7 by default. In MariaDB disabled by default.
  • Replication incompatibilities from MariaDB (Master) to MySQL (Slave)
  • MariaDB 10.2.0 still contains XtraDB 5.6. So MySQL 5.7 features cannot be used.
  • MariaDB 10.2 Window Functions are missing in MySQL 5.7
  • SHOW PROCESSLIST has additional column Progress in MariaDB.
  • Progress indication in: mysqldump …

FromDual Nagios and Icinga plugins v1.0.1 for MySQL/MariaDB released

FromDual has the pleasure to announce the release of the new version 1.0.1 of the FromDual Nagios and Icinga plugins for MySQL, Galera Cluster and MariaDB.

Download

The new FromDual Nagios plugins can be downloaded here.

In the inconceivable case that you find a bug in the FromDual Nagios plugins please report it to our bug tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to [feedback@fromdual.com](mailto:feedback@fromdual.com?Subject=Feedback for Nagios plugins). …

MariaDB and MySQL developer training

You are already a database application developer or on the way there. Now you would like to learn more about, what MySQL and MariaDB features are available which you can use later to build even better applications, to develop more efficiently applications and shorten your time to market.

Requirements

You are already familiar with the SQL language and have already some experience with MySQL or any other relational SQL database system.

Audience

  • Future MySQL application developer
  • MySQL and MariaDB database …

MariaDB, Galera and MySQL training class schedule

We offer our MySQL and MariaDB trainings together with well-respected training organizations: The Linuxhotel in Essen (Germany), the Heinlein Academy in Berlin (Germany) and GFU Cyrus AG in Cologne (Germany). Our own MySQL and MariaDB training classes are hold in the building of the HSO in Zürich (Switzerland).

If you prefer a MySQL or MariaDB in-house training at your location and if you provide the infrastructure we are happy to train you on-site either in German or English as well.

Further dates or dates …

MariaDB, Galera und MySQL training modules

FromDual offers different MySQL, Galera Cluster and MariaDB training modules. For training dates see our MySQL and MariaDB training class schedule.

SQL for Beginners (3 days)

This training is made for all who want to learn the basics of the SQL language. Future DBAs, database developers and data analysts.

MySQL and MariaDB for Beginners (2 days)

This MySQL and MariaDB training is made for those who want to learn the basics of the MySQL database system. Future MySQL DBAs and MySQL database developers.

MySQL …

Download Performance Monitor

FromDual Performance Monitor for MySQL and MariaDB including MaaS

The FromDual Performance Monitor for MySQL, Galera Cluster, MariaDB and Percona Server is a Monitoring solution based on Zabbix. Its various alerts, advisors and graphs help you to monitor and operate your MySQL databases. This solution is also available as Monitoring as a Service solution if you want to avoid the hassle of installing your own monitoring solution.

Get the Latest release.

FromDual Performance Monitor for MySQL and MariaDB 0.10.5 has been released

FromDual has the pleasure to announce the release of the new version 0.10.5 of its popular Database Performance Monitor for MySQL, MariaDB, Galera Cluster and Percona Server fpmmm.

You can download fpmmm from here.

In the inconceivable case that you find a bug in fpmmm please report it to our Bug-tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

This release contains various bug fixes and improvements. The previous release had some major bugs …

Migration from other databases to MySQL or MariaDB

Database migration tools

A generic database migration tool to MySQL and MariaDB is the MySQL Workbench.

An alternative is the old MySQL Migration Tool Kit.

Recommended by MariaDB Foundation: Sqlines.

Adabas D to MariaDB migration

Project migrating an Adabas D database to MariaDB is in progress. More information are expected before end of 2015.

Oracle to MySQL or MariaDB migration

Data Migration Tools

  • MyOraDump is a tool to export data from an Oracle database to MySQL or MariaDB. …

FromDual Performance Monitor for MySQL and MariaDB 0.10.4 has been released

FromDual has the pleasure to announce the release of the new version 0.10.4 of its popular Database Performance Monitor for MySQL, MariaDB, Galera Cluster and Percona Server fpmmm.

You can download fpmmm from here.

In the inconceivable case that you find a bug in fpmmm please report it to our Bug-tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

This release contains various minor bug fixes and improvements.

New installation of fpmmm v0.10.4 …

FromDual Performance Monitor for MySQL and MariaDB 0.10.1 has been released

FromDual has the pleasure to announce the release of the new version 0.10.1 of its popular Database Performance Monitor for MySQL, MariaDB, Galera Cluster and Percona Server fpmmm.

You can download fpmmm from here.

In the inconceivable case that you find a bug in fpmmm please report it to our Bug-tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

This release contains various minor bug fixes and improvements. Mainly it was a rewrite from Perl …

Nagios and Icinga plugins for MySQL/MariaDB released

FromDual is pleased to announce the release of a new version 1.0.0 of the Nagios and Icinga plugins for MySQL, MariaDB, Percona Server and Galera Cluster.

Any information about the changes and the new functions of the Nagios and Icinga plugins you can find here.

If you have any problems with the new version you can reach us by e-mail at: contact@fromdual.com or by phone on +41 44 500 58 20.

Your FromDual Team

Impacts of max_allowed_packet size problems on your MySQL database

We recently run into some troubles with max_allowed_packet size problems during backups with the FromDual Backup/Recovery Manager and thus I investigated a bit more in the symptoms of such problems.

Read more about: max_allowed_packet.

A general rule for max_allowed_packet size to avoid problems is: All clients and the server should have set the same value for max_allowed_packet size!

I prepared some data for the test which looked as follows:

mysql> SELECT id, LEFT(data, 30), LENGTH(data), ts FROM test; …

Migration between MySQL/Percona Server and MariaDB

This week, we did some migrations from MariaDB 10.0 to Percona Server 5.6 at the IT department of a big German bank.

We were perfectly aware that since version 10.0 the MariaDB code base started to diverge slightly away from the MySQL and Percona Server code base which are still pretty close to each other.

Because of the Percona Server option enforce_storage_engine we wanted to do this migration.

We stopped the MariaDB 10.0 server, replaced the binaries by the Percona Server 5.6 binaries, and started the …

Comparing MySQL, MariaDB and Percona Server

MySQL Percona MariaDB
Company Oracle Corp.
(former MySQL AB)
Percona LLC MariaDB Corp.
(former SkySQL)
FromDual support Ok-icon.png Ok-icon.png Ok-icon.png
GA versions 5.5, 5.6 5.5, 5.6 5.5, 10.0
Galera Cluster supported supported supported
License GPL, commercial (OEM!) GPL GPL, LGPL, BSD
Ancestry Mother of all Branch of actual release Fork of MySQL 5.5
Storage Engines Archive, Blackhole, CSV, Federated (disabled), InnoDB (default), Memory, MyISAM Archive, Blackhole, CSV, Federated (disabled), InnoDB (default), …

FromDual Performance Monitor for MySQL 0.9.3 has been released

FromDual has the pleasure to announce the release of the new version 0.9.3 of its popular Database Performance Monitor for MySQL, Galera Cluster, MariaDB and Percona Server fpmmm.

This release contains various minor bug fixes and improvements.

You can download fpmmm from here.

In the inconceivable case that you find a bug in fpmmm please report it to our Bugtracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

New installation of fpmmm v0.9.3 …

FromDual Performance Monitor for MySQL 0.9.2 has been released

FromDual has the pleasure to announce the release of the new version 0.9.2 of its popular Database Performance Monitor for MySQL, MariaDB and Percona Server mpm.

This release makes mpm compatible with Zabbix v2.2 and contains various minor bug fixes and improvements.

You can download mpm from here.

In the inconceivable case that you find a bug in mpm please report it to our Bugtracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

New installation …

MySQL and MariaDB support subscription

Will you be at a loss having a MySQL or MariaDB database problem? Will you need urgently help from experienced FromDual staff when your production MySQL or MariaDB database stops working? Or do you need a third party opinion for one of your MySQL or MariaDB solutions?

FromDual offers you vendor independent database support for MySQL (community and enterprise edition), MariaDB (community and enterprise edition) and Percona Server for all versions starting with 4.0.

How we provide support?

Our FromDual …

What are the costs of one hour MySQL downtime?

Hello,

there are companies which earn tens of thousands of Euros per hour with their MySQL databases. Other companies operate their ERP system on MySQL, to which 1000 employees are attached to. Is the database down 1000 people are not working any more until the system is working again! Downtime costs starting at EUR 30'000.- per hour upwards.

Support through the MySQL specialists?

These companies have properly planned operations of their MySQL databases, designed their production systems redundantly and …

MySQL single query performance - the truth!

MySQL single query performance - the truth!

As suggested by morgo I did a little test for the same query and the same data-set mentioned in Impact of column types on MySQL JOIN performance but looking into an other dimension: the time (aka MySQL versions).

The answer

To make it short. As a good consultant the answer must be: “It depends!” :-)

The test

The query was again the following:

SELECT *
  FROM a
  JOIN b ON b.a_id = a.id
 WHERE a.id BETWEEN 10000 AND 15000
;

The Query Execution Plan was …

Impact of column types on MySQL JOIN performance

In our MySQL trainings and consulting engagements we tell our customers always to use the smallest possible data type to get better query performance. Especially for the JOIN columns. This advice is supported as well by the MySQL documentation in the chapter Optimizing Data Types:

Use the most efficient (smallest) data types possible. MySQL has many specialized types that save disk space and memory. For example, use the smaller integer types if possible to get smaller tables. MEDIUMINT is often a better …

tags: 

DOAG SIG MySQL - Replication: September 4, 2012 in Hamburg

On Tuesday, September 4, 2012 the next DOAG SIG MySQL meeting will take place in Hamburg (Germany) with the topic Replication.

Possible presentations are: MySQL Replication, Galera Cluster, Replication with Oracle GoldenGate, Replication with Zimory Scale and Tungsten Replicator.

The event will presumably be located at the Hotel Böttcherhof at Wöhlerstrasse 2.

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. …

MySQL Schulung für Profis am 18.-22. Juni in Berlin

Am 18. bis 22. Juni findet an der Heinlein Akademie in Berlin ein fünftägiger hands-on Workshop MySQL für Profis statt. Es hat noch Plätze frei!

Anmeldung und weitere Infos unter: http://www.heinlein-support.de/schulung/mysql-fuer-profis

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 …

Codership partners with FromDual to offer consulting and support services for Galera Cluster for MySQL

Helsinki, Finland, Uster, Switzerland – February 18, 2012 – Codership, the provider of Galera Cluster for MySQL, and FromDual, a MySQL consulting company, today announced collaboration to offer Galera Cluster technology and related support and consulting services for Galera users all over the world, especially in German speaking countries Germany, Austria and Switzerland (DACH). Galera Cluster is a synchronous, true multi-master replication cluster for MySQL using the well known InnoDB storage engine. …

Example 1

CREATE TABLE `order` (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, name VARCHAR(64) NOT NULL
) ENGINE = InnoDB;

INSERT INTO `order` VALUES
  (NULL, 'Test order 1')
, (NULL, 'Test order 2')
, (NULL, 'Test order 3');


CREATE TABLE pos (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, order_id INT UNSIGNED NOT NULL
, name VARCHAR(64) NOT NULL
, amount SMALLINT NOT NULL
, price DECIMAL (6,2) NOT NULL
, status TINYINT NULL
) ENGINE = InnoDB;

INSERT INTO pos VALUES
  (null, 1, 'Schrauben', …

Migrating from MySQL Master-Master Replication to Galera Multi-Master Replication

Introduction

Galera is a synchronous Multi-Master Replication for MySQL. It is therefore in competition with several other MySQL architectures:

Very often they can be easily replaced by Galera’s synchronous Multi-Master Replication for MySQL.

All those products have some advantages and disadvantages. Very often MySQL Master-Master Replication is used in the field because of its simplicity to set-up. But …

MySQL vs. PostgreSQL

Im Admin-Magazin 2011/06 hat es einen netten Artikel über MySQL und PostgreSQL Performance Tuning: Duell der Datenbanken: In einem Shootout messen sich MySQL und PostgreSQL

Susanne hat dabei PostgreSQL, wir MySQL betreut…

MySQL Vala Program Example

Summary: In this article we have a short look at a simple MySQL example program written in Vala.

Recently a customer pointed me to a programming language called Vala. Vala is a C-style programming language generating C code which afterwards can be compiled and linked with the normal gcc.
This I found pretty useful to not mess around with pointers and all this stuff in C and to be capable anyway to write C programs for some projects I had in mind in my head since long.
Vala is mostly used around the Gnome …

Advanced MySQL DBA Workshop

With a partner we are planning and Advanced MySQL DBA workshop. As the name says it should be a workshop. Its planned duration is 2 days. So within 2 days we can cover 4 to 8 topics more deeply. Requirements: VirtualBox, VMware, own Laptop?

Possible exercises during the workshop

  • Set-up a Master-Master replication with 2 Slaves
  • Load balance on master with MySQL Proxy and on Slaves with LVS.
  • Design a little schema and load with data from foodmart
  • Do a backup with XtraDB and LVM
  • Do a PITR and and InnoDB crash …

How good is MySQL INSERT TRIGGER performance

Abstract: In this article we discuss how big is the performance impact of MySQL TRIGGERs compared to application side logging (with INSERT) into a MySQL table.

What was in my mind from the past

A while ago when MySQL released its Stored Language features in v5.0 I have seen a book
[1
] about this topic. In this book was a performance comparison between different implementations of computational tasks, one was done in MySQL Stored Language. The result was, that MySQL Stored Language feature sucks also …

MySQL out in the wild

One of our partners recently asked me on what platforms do we usually see MySQL installed out there…

The last 5 years I gave the answer: Typically it is 80% Linux, 10% Windows, 5% Solaris and 5% all others. But this was only the picture of my limited view and I was not sure how objective this was.

This time I really wanted to know it and so I collected the information of about 570 MySQL installations of customers.

The following numbers came out:

Operating System

OS cnt %
Mac OSX 3 0.5% …

German speaking MySQL User Group (DMySQLAG) founded today

Today the German speaking MySQL User Group (DMySQLAG) was officially founded in Berlin. The association advocates:

  • the information of the use, the handling and the experience with MySQL and development in the MySQL Eco-System as well as systems which use MySQL.
  • the exchange of experience between MySQL users about MySQL and other systems.
  • the Advice and Cooperation with Oracle and vendors of other systems.
  • the submission of suggestions of the members to Oracle and vendors of other systems.

The intention of …

When a MySQL table was last touched

In our last customer project we had around 600 Gbyte of data in a MySQL database. Because this database consumed a significant amount of our disk space and backups with the InnoDB backup tool took pretty long we wanted to find out if we could get rid of some of the tables.

This application was growing over the last 10 years and it was not clear if some tables are still in use or not.

But how to find out when a table was touched last? MySQL/InnoDB theoretically could know about but does not report this …

Dumping BLOB's from the MySQL database

A customer who is handling digital certificates had a problem with one of those. So we had to investigate.

Because the certificate is in binary form it is stored in a BLOB and we had to extract it from the database to do some verifications.

What first came to my mind was to extract the certificate with the SELECT INTO OUTFILE command. But the verification tool complained and told us that the certificate has a wrong format.

Luckily I found in the documentation the following statement: If you use INTO …

PrimeBase Technologies and FromDual form a Service-Cooperation for MySQL products

From the Cooperation of these two companies arises the biggest independent service provider for MySQL and MariaDB in Europe.

Hamburg, Uster – February 28, 2011 - The Hamburg based PrimeBase Technologies and the near Zürich located FromDual are forming a Cooperation for MySQL products and services, starting March 1st, 2011.

This Cooperation enables both companies to offer a complete set of services for all MySQL and MariaDB customers.

The customers of both parties now have he possibility to demand a …

FromDual releases new version of its MySQL Performance Monitor

FromDual releases its new version v0.5 of its MySQL Performance Monitor working with Zabbix.

What has changed so far in this release:

  • Recommended Location has changed to /usr/local
  • FromDual agent log files are rotated now.
  • There are now 2 different packages: One for the Agent and one for the Templates.
  • Some of the graphs were improved.
  • Missing status and system variable information were added and some were fixed.
  • Verbosity of logging information was adjusted.
  • A module for monitoring additional informations …

FromDual partner

FromDual cooperates with the following companies:


Topic Company Description
MariaDB/MySQL Training Linuxhotel GmbH The Linuxhotel is one of the most important Open Source Software training and meeting places in German-speaking countries. Linuxhotel
MariaDB Support MariaDB AB FromDual helps you to get into MariaDB Enterprise Subscriptions and Services. MariaDB
MariaDB/MySQL Training GFU Cyrus AG GFU is one of the most important Enterprise training facilities in Germany. GFU
MariaDB/MySQL Training Heinlein Academy …

MySQL Client Error Codes and Messages 2050 - 2099

2000 - 2049

  • Error: 2050 (CR_FETCH_CANCELED)

    Message: Row retrieval was canceled by mysql_stmt_close() call

  • Error: 2051 (CR_NO_DATA)

    Message: Attempt to read column without prior row fetch

  • Error: 2052 (CR_NO_STMT_METADATA)

    Message: Prepared statement contains no metadata

  • Error: 2053 (CR_NO_RESULT_SET)

    Message: Attempt to read a row while there is no result set associated with the statement

  • Error: 2054 (CR_NOT_IMPLEMENTED)

    Message: This feature is not implemented yet

  • Error: 2055 ( …

MySQL Client Error Codes and Messages 2000 - 2049

1700 - 1749 2050 - 2099

  • Error: 2000 (CR_UNKNOWN_ERROR)

    Message: Unknown MySQL error

  • Error: 2001 (CR_SOCKET_CREATE_ERROR)

    Message: Can’t create UNIX socket (%d)


  • Error: 2002 (CR_CONNECTION_ERROR) Message: Can’t connect to local MySQL server through socket ‘%s’

    How does the MySQL error message look like?

    shell> mysql --user=root --socket=/tmp/mysql.sock
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    

    What does the MySQL error …

MySQL Server Error Codes and Messages 1700 - 1749

1650 - 1699 2000 - 2049

  • Error: 1700 SQLSTATE: HY000 (ER_GRANT_PLUGIN_USER_EXISTS)

    Message: GRANT with IDENTIFIED WITH is illegal because the user %-.
    *s already exists

  • Error: 1701 SQLSTATE: 42000 (ER_TRUNCATE_ILLEGAL_FK)

    Message: Cannot truncate a table referenced in a foreign key constraint (%s)

  • Error: 1702 SQLSTATE: HY000 (ER_PLUGIN_IS_PERMANENT)

    Message: Plugin ‘%s’ is force_plus_permanent and can not be unloaded

  • Error: 1703 SQLSTATE: HY000 ( …

MySQL Server Error Codes and Messages 1650 - 1699

1600 - 1649 1700 - 1749

  • Error: 1650 SQLSTATE: HY000 (ER_SLAVE_IGNORE_SERVER_IDS)

    Message: The requested server id %d clashes with the slave startup option –replicate-same-server-id

  • Error: 1651 SQLSTATE: HY000 (ER_QUERY_CACHE_DISABLED)

    Message: Query cache is disabled; restart the server with query_cache_type=1 to enable it

  • Error: 1652 SQLSTATE: HY000 (ER_SAME_NAME_PARTITION_FIELD)

    Message: Duplicate partition field name ‘%s’

  • Error: 1653 SQLSTATE: HY000 ( …

MySQL Server Error Codes and Messages 1600 - 1649

1550 - 1599 1650 - 1699

MySQL Server Error Codes and Messages 1550 - 1599

1500 - 1549 1600 - 1649

  • Error: 1550 SQLSTATE: HY000 (ER_EVENT_COMPILE_ERROR)

    Message: Error during compilation of event’s body

  • Error: 1551 SQLSTATE: HY000 (ER_EVENT_SAME_NAME)

    Message: Same old and new event name

  • Error: 1552 SQLSTATE: HY000 (ER_EVENT_DATA_TOO_LONG)

    Message: Data for column ‘%s’ too long

  • Error: 1553 SQLSTATE: HY000 (ER_DROP_INDEX_FK)

    Message: Cannot drop index ‘%s’: needed in a foreign key constraint

  • Error: 1554 SQLSTATE: HY000 ( …

MySQL Server Error Codes and Messages 1500 - 1549

1450 - 1499 1550 - 1599

MySQL Server Error Codes and Messages 1450 - 1499

1400 - 1449 1500 - 1549

  • Error: 1450 SQLSTATE: HY000 (ER_FORBID_SCHEMA_CHANGE)

    Message: Changing schema from ‘%s’ to ‘%s’ is not allowed.

  • Error: 1451 SQLSTATE: 23000 (ER_ROW_IS_REFERENCED_2)

    Message: Cannot delete or update a parent row: a foreign key constraint fails (%s)

  • Error: 1452 SQLSTATE: 23000 (ER_NO_REFERENCED_ROW_2)

    Message: Cannot add or update a child row: a foreign key constraint fails (%s)

  • Error: 1453 SQLSTATE: 42000 (ER_SP_BAD_VAR_SHADOW)

    Message: Variable …

MySQL Server Error Codes and Messages 1400 - 1449

1350 - 1399 1450 - 1499

  • Error: 1400 SQLSTATE: XAE09 (ER_XAER_OUTSIDE)

    Message: XAER_OUTSIDE: Some work is done outside global transaction

  • Error: 1401 SQLSTATE: XAE03 (ER_XAER_RMERR)

    Message: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency

  • Error: 1402 SQLSTATE: XA100 (ER_XA_RBROLLBACK)

    Message: XA_RBROLLBACK: Transaction branch was rolled back

  • Error: 1403 SQLSTATE: 42000 (ER_NONEXISTING_PROC_GRANT)

    Message: There is no such grant defined for user …

MySQL Server Error Codes and Messages 1350 - 1399

1300 - 1349 1400 - 1449

  • Error: 1350 SQLSTATE: HY000 (ER_VIEW_SELECT_CLAUSE)

    Message: View’s SELECT contains a ‘%s’ clause

  • Error: 1351 SQLSTATE: HY000 (ER_VIEW_SELECT_VARIABLE)

    Message: View’s SELECT contains a variable or parameter

  • Error: 1352 SQLSTATE: HY000 (ER_VIEW_SELECT_TMPTABLE)

    Message: View’s SELECT refers to a temporary table ‘%s’

  • Error: 1353 SQLSTATE: HY000 (ER_VIEW_WRONG_LIST)

    Message: View’s SELECT and view’s field list have …

MySQL Server Error Codes and Messages 1300 - 1349

1250 - 1299 1350 - 1399

MySQL Server Error Codes and Messages 1250 - 1299

1200 - 1249 1300 - 1349

MySQL Server Error Codes and Messages 1200 - 1249

1150 - 1199 1250 - 1299


  Error: 1200 SQLSTATE: HY000 (ER_BAD_SLAVE)
  Message: The server is not configured as slave; fix in config file or with CHANGE MASTER TO

How does the MySQL error message look like?


  Error: 1201 SQLSTATE: HY000 (ER_MASTER_INFO)
  Message: Could not initialize master info structure; more error messages can be found in the MySQL error log

How does the MySQL error message look like?


  Error: 1202 SQLSTATE: HY000 (ER_SLAVE_THREAD)
  Message: Could not create slave thread; …

MySQL Server Error Codes and Messages 1150 - 1199

1100 - 1149 1200 - 1249


  Error: 1153 SQLSTATE: 08S01 (ER_NET_PACKET_TOO_LARGE)
  Message: Got a packet bigger than …

MySQL Server Error Codes and Messages 1100 - 1149

1050 - 1099 1150 - 1199

  • Error: 1100 SQLSTATE: HY000 (ER_TABLE_NOT_LOCKED)

    Message: Table ‘%s’ was not locked with LOCK TABLES

  • Error: 1101 SQLSTATE: 42000 (ER_BLOB_CANT_HAVE_DEFAULT)

    Message: BLOB/TEXT column ‘%s’ can’t have a default value

  • Error: 1102 SQLSTATE: 42000 (ER_WRONG_DB_NAME)

    Message: Incorrect database name ‘%s’

  • Error: 1103 SQLSTATE: 42000 (ER_WRONG_TABLE_NAME)

    Message: Incorrect table name ‘%s’

  • Error: 1104 SQLSTATE: 42000 ( …

MySQL Server Error Codes and Messages 1050 - 1099

1000 - 1049 1100 - 1149


Error: 1050 SQLSTATE: 42S01 (ER_TABLE_EXISTS_ERROR)

Message: Table ‘%s’ already exists

MySQL Server Error Codes and Messages 1000 - 1049

1050 - 1099

  • Error: 1000 SQLSTATE: HY000 (ER_HASHCHK)

    Message: hashchk

  • Error: 1001 SQLSTATE: HY000 (ER_NISAMCHK)

    Message: isamchk

  • Error: 1002 SQLSTATE: HY000 (ER_NO)

    Message: NO

  • Error: 1003 SQLSTATE: HY000 (ER_YES)

    Message: YES

  • Error: 1004 SQLSTATE: HY000 (ER_CANT_CREATE_FILE)

    Message: Can’t create file ‘%s’ (errno: %d)

  • Error: 1005 SQLSTATE: HY000 (ER_CANT_CREATE_TABLE)

    Message: Can’t create table ‘%s’ (errno: %d)


  Error: 1006 SQLSTATE: HY000 …

MySQL Error codes and messages

Just a general rule with error messages: Usually they are not as good as they could be. But nevertheless read them carefully. Most of the time they tell you what you need to know…

And an other wisdom: Errors are really errors and they have to be solved. Warnings are warnings and you should investigate if they appear. Do not ignore both of them unless you have clearly understood what you are doing.

With MySQL:

mysql> SHOW WARNINGS

is often your friend! Further sources to find the problems are: …

MyEnv for MySQL Multi-Database set-ups

This week I showed one of my customers our MyEnv. He was very interested in it and suggested to make it known in public. In fact MyEnv is available for download already several years…

But I did not have the heart yet to announce it more publicly because it was not end user ready at all. So I used the weekend to make it nicer, consolidated some of the code, dropped old stuff etc. Now I think it is acceptable to use for public but not perfect.

So what is MyEnv?

MyEnv is a set of scripts to run …

FromDual plans Advanced MySQL DBA Workshop

With one of its partners FromDual plans to offer an Advanced MySQL DBA Workshop. The first workshop should run in November 2010.

To offer the best possible contents to the participants we want your feedback about the proposed topics, about the missing topics and what you think in general about such a workshop.

Please let us know your opinion. Either as comment on our web-site or for our eyes only at Feedback.

Thank you for your participation.

Advanced MySQL DBA Workshop - draft

With a partner we are planning and Advanced MySQL DBA workshop. As the name says it should be a workshop. Its planned duration is 2 days. So within 2 days we can cover 4 to 8 topics more deeply.

Requirements: VirtualBox, VMware, own Laptop?

Possible exercises during the workshop

  • Set-up a Master-Master replication with 2 Slaves
  • Load balance on master with MySQL Proxy and on Slaves with LVS.
  • Design a little schema and load with data from foodmart
  • Do a backup with XtraDB and LVM
  • Do a PITR and and InnoDB crash …

ODBA Interview with FromDual about the MySQL/MariaDB future

Henrik Ingo from the Open Database Alliance (ODBA) did an interview with Oli Sennhauser of FromDual about the European MySQL database landscape and its future. If you want to know more about our opinion in this matter please read here.

For more technical insight see also our former presentation: MySQL, where are you going?.

How the MySQL Optimizer with MySQL Cluster is cheating you...

At a customer we had a nice example of how the MySQL Optimizer is cheating when used in combination with the MySQL Cluster. The customer had queries running not too slow in the development environment but when he tried them on the acceptance test environment (with more data) the query was running much too long which was unacceptable because this query can occur many times per second.

What has happened?

First of all we had a look at the execution plan of the query generated by the MySQL Optimizer:

EXPLAIN …

FromDual becomes Open Database Alliance (ODBA) Silver Partner

Uster, Switzerland – April 26, 2010 – FromDual has signed the Service Provider Partnership Agreement of the Open Database Alliance (ODBA).

FromDual is the first official ODBA consulting partner in Europe. The growing number of downloads and use of MariaDB, an improved and enhanced derivation of the MySQL database, also requires consultancy services for MariaDB in Europe.

We are excited to be working with ODBA as their first consulting partner in Europe says Oliver Sennhauser, Owner of FromDual. …

FromDual becomes Open Database Alliance (ODBA) Silver Partner

Uster, Switzerland – April 26, 2010 – FromDual has signed the Service Provider Partnership Agreement of the Open Database Alliance (ODBA).

FromDual is the first official ODBA consulting partner in Europe. The growing number of downloads and use of MariaDB, an improved and enhanced derivation of the MySQL database, also requires consultancy services for MariaDB in Europe.

We are excited to be working with ODBA as their first consulting partner in Europe says Oliver Sennhauser, Owner of FromDual. …

MySQL, where are you going?

Our presentation MySQL, where are you going? of March 25 at the OpenExpo in Bern is now available in German and English.

When you have missed it, you can download it now from here

The video recording should be available as well soon.

MySQL Architectures Overview

Database Architecture & Design

Application logic in the middle tier?

Reduce money spent on software licenses by moving logic to the middle tier. This means moving stored procedures into the application server or web server layer where it is much cheaper to scale out. Reducing or eliminating business logic running in the DB may reduce Database CPU utilisation and hence save support costs for the DB Portability is key! [1]

The complete Open Source MySQL High Availability and Scale-Out Architecture Stack …

MySQL hints

Table of Contents

Result set with temporary sequence

Sometimes you would like to have a result set with something like a rownum. You can do this at least in the following two ways:

a) with a TEMPORARY MEMORY table:

CREATE TEMPORARY TABLE mem (
    seq  INT NOT NULL …

The handler_read_* status variables

Because I do a lot of Performance Tuning gigs I get often in contact with these status variables. In the beginning I had a problem to understand them and now I have a problem to memorize the relation of the name and the meaning. Therefore I wrote this little summary:

Prepare the example

To show you the effect I have worked out a little example:

CREATE TABLE test (
    id    INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  , data  VARCHAR(32)
  , ts    TIMESTAMP
  , INDEX (data)
);

INSERT INTO test
VALUES …

Performance Tuning Key for MySQL

This MySQL Performance Tuning Key should give you a guide how to best tune you MySQL database systematically… It should also work similar for other RDBMS.

Also check our MySQL Performance Monitor

For a database configuration tuning only please look first at our MySQL database health check.

If this MySQL Database Health Check does NOT solve your problem our specialized Performance Tuning and Architecture Consultants can help you for sure!

Caution: Some recommendations are dangerous! Dangerous means …

MySQL Monitoring solutions

Basic solutions (CLI)

Those solutions are run from the command line (CLI):

Advanced solutions

More advanced MySQL database and host monitoring solutions with graphs and/or history and/or hints are:

MySQL Performance Monitor The FromDual Performance Monitor for MySQL/MariaDB is a monitoring solution based on Zabbix. It is freely …

Profiling MySQL with oprofile

Why is is data load with LOAD DATA INFILE so much faster?

Probably the answer to this question is already known. But we want to prove it and by the way learn to deal with oprofile.

For the test MySQL 5.0.28 was used and 100k rows were loaded into a table sales which looks as follows:

CREATE TABLE sales (
    sales_id       INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  , product_name   VARCHAR(128) NOT NULL
  , product_price  DECIMAL(8,2) NOT NULL
  , product_amount SMALLINT     NOT NULL
) ENGINE = …

FromDual - The MySQL consulting company goes operational today!

Hello everybody,

One month earlier than planned we have the great pleasure to announce you that the company called FromDual goes operational today!

We are excited about this step and it is an new era in our personal evolution to get back in full-contact with customers and solve their real life day-to-day MySQL problems.

So we are happy hearing from you and to help you solving your individual MySQL problems…

You can find us at FromDual or you can contact us here.

Regards,
Oli Sennhauser (aka Shinguz) …

Presentations

The following presentations are available:

Date Title Location Lang
November, 2025 MySQL Honeypot (PDF, 324 kib) DOAG 2025 Konferenz + Ausstellung, 18 - 20 November 2025, Nürnberg, D D
November, 2024 MySQL Performance Tuning (PDF, 791 kib), Was ist neu in MySQL 8.4? (PDF, 407 kib) DOAG 2024 Konferenz + Ausstellung, 19 - 21 November 2024, Nürnberg, D D
August, 2024 Was ist neu in MariaDB 11.4? (PDF, 271 kib) FrOSCon 2024, 17 and 18 August 2024, St. Augustin, D D
November, 2023 Das …

Logging users to the MySQL error log

Problem

A customer recently showed up with the following problem:

*With your guidelines
[ 1
] I am now able to send the MySQL error log to the syslog and in particular to an external log server.
But I cannot see which user connects to the database in the error log.

How can I achieve this?*

Idea

During night when I slept my brain worked independently on this problem and in the morning he had prepared a possible solution for it.

What came out is the following:

  • We create an UDF which allows an application to …

Can you trust your MySQL backup?

Today a customer with corrupted data files showed up. When we enquired a bit more he told us that he had a broken I/O controller. This is one of the worst things which can happen to you!

The reason is the following: When a I/O controller starts to die it often does not happen immediately. The controller dies slowly producing more and more corrupt data. When you just write data without checking or reading them it can take days or even weeks until you discover the problem.

But the nasty thing is, that even …

What is CHECK TABLE doing with InnoDB tables?

Recently we had a case where a customer got some corrupted blocks in his InnoDB tables. His largest tables where quite big, about 30 to 100 Gbyte. Why he got this corrupted blocks we did not find out yet (disk broken?).

When you have corrupted blocks in InnoDB, it is mandatory to get rid of them again. Otherwise your database can crash suddenly.

If you are lucky only “normal” tables are concerned. So you can dump, drop, recreate and load them again as described in the InnoDB recovery procedure …

MySQL on VMware Workstation/DRBD vs. VMWare ESX Server/SAN

Or an active-active failover cluster à la VMware.

Today I have learned about a totally crazy/cool looking architecture where the expensive VMware ESX server was replace by a free/cheap VMware Workstation version in combination with DRBD.

Basically DRBD we name the poor man’s SAN and that is exactly what this customer is doing. He replaced the SAN with DRBD and now he can easily move one VMware instance to the other host. Possibly it is not that flexible and powerful as an ESX Server but also not so …

The battle against Oracle is probably over but has the real war begun yet?

According to different sources from the web the decision about the Oracle - Sun merger has been approved by the European commission soon. So at least in the West it is clear what is going on. Let us see what the East decides…
[ 1
],
[ 2
].

Oracles arch-enemy Microsoft has already brought its weapons in position against the target with its: Microsoft offers Oracle-phobes MySQL migration tool"
[ 3
],
[ 4
]. So far so good. Nothing new, nothing special.

What made me a bit edgy was the following …

MySQL reporting to syslog

There are 2 different possible situations you can face when you have to deal with MySQL and syslog:

  • MySQL is used as back-end for syslog to store the logging information.
    [ 6
    ]
  • MySQL itself should report to the syslog.

In this blog article we look at the second situation: How can you make MySQL reporting to the syslog.

Since the version 5.1.20 MySQL is capable to log to the syslog
[ 1
],
[ 2
]. This is done by the MySQL angel process mysqld_safe.

You can enable the syslog when you add the syslog parameter …

My wish for the New Year: MySQL DBA's, please install iostat on your servers!

iostat is a very handy tool to help you investigating what kind of performance problems you have. Especially your databases can cause a lot of troubles to your I/O system and thus it would be very nice if every DBA has installed iostat on all of his MySQL database servers.

Unfortunately most of the Linux distributions do NOT install iostat by default. This causes often unfortunate situations when you are in a MySQL consulting engagement or have a MySQL support case and ask the customer for the output of …

MariaDB and MySQL Consulting

FromDual delivers neutral and vendor independent on-site consulting services on MariaDB, MySQL, Galera Cluster and Percona Server. Our experienced consultants recommend you the best solutions fitting to your needs.

We help you in delicate matters as:

  • Getting the maximum out of your current hardware through Performance Tuning and SQL Query Tuning by adding indexes where necessary.
  • Evaluating more advanced Database Architectures like Master/Slave Replication or synchronous multi-Master Replication with …

FromDual Tools for MySQL and MariaDB

Performance Monitor for MySQL (mpm)

The FromDual Performance Monitor for MySQL (mpm) is a monitoring solution for MySQL, MySQL Cluster, Galera Cluster, Percona Server and MariaDB databases. The mpm can be downloaded from here.

It is based on the monitoring solution Zabbix.

The Performance Monitor for MySQL (mpm) supports the following Storage Engines:

  • MyISAM / Aria
  • InnoDB / XtraDB
  • NDB
  • PBXT

Further you can also monitor:

  • Master - Slave replication set-ups
  • Unix processes (mysqld, ndbd)
  • MySQL/Percona/MariaDB …

MySQL useful add-on collection using UDF

I really like this new toy (for me) called UDF. So I try to provide some more, hopefully useful, functionality.

The newest extension I like is the possibility to write to the MySQL error log through the application. Oracle can do that since long. Now we can do this as well…

A list of what I have done up to now you can find here:

Using MySQL User-Defined Functions (UDF) to get MySQL internal informations

In one of my previous posts I was writing about how to read other processes memory
[ 1
]. As an example I tried to get the value of the hard coded MySQL internal InnoDB variable spin_wait_delay (srv_spin_wait_delay).

In this example we were using gdb or the operating system ptrace function to retrieve this value. This method has the disadvantage that it is pretty invasive.

When I was working on a customer support case I had the idea to solve this by the much less invasive method of User-Defined Functions …

Determine in MySQL if we are in summer time or winter time (daylight saving time, DST)

Recently a colleague at Sun was asking me if MySQL can tell him to determine if we are currently in summer time or winter time. He was doing some data analysis of his house where he has installed solar panels.

I am not aware of what he wants to do exactly, but possibly he wants all the data in solar time. So UTC could help him because UTC does not change much over time.

Next thing which came to my mind is, that possibly the good place to do such mathematical calculations is the application code and not the …

MySQL licenses for dummies

The following summary shows my personal understanding of MySQL 5.1 licenses, packages and products. It does not necessarily reflect 100% the way MySQL understands it. But after all the discussions I hope it is as close as possible to the reality:

MySQL Embedded Database Server

(Download → OEM Software)

Classic  (OEM license, -MEM -InnoDB)
Pro      (= Classic +InnoDB)
Advanced (= Pro +Partitioning)

MySQL Community Sever

(Download → Download)

Community (GPL, -NDB)

MySQL Enterprise Server

(Download → …

Test application for MySQL high availability (HA) set-up

When I set-up a MySQL HA environment for customers I usually do some final failover tests after configuring the whole beast.

To check if the application behaves like expected I always run my little test application (test.sh) from the server(s) where the customers application runs. It displays “graphically” how the application behaves and you can show to the customer immediately what is going on…

Make sure, that you point it to the virtual IP (VIP) or the load balancer (LB).

It was really …

Citation of the week

Das dreieckige Rad hat gegenüber dem viereckigen einen gewaltigen Vorteil: Ein Rumms weniger pro Umdrehung!

Translation:

The triangular wheel has one enormous advantage over the quadrangular: One knock less per revolution!

Maybe not new, but I have not heard it yet and I love it. It was about reinventing functionality in a well known product…

Active/active failover cluster with MySQL Replication

Electing a slave as new master and aligning the other slaves to the new master

In a simple MySQL Replication set-up you have high-availability (HA) on the read side (r). But for the master which covers all the writes (w) and the time critical read (rt) there is no HA implemented. For some situations this can be OK. For example if you have rarely writes or if you can wait until a new Master is set up.

But in other cases you need a fast failover to a new master.

In the following article it is shown how to …

Typical automated MySQL maintenance jobs, query cache

The following maintenance jobs are typically run against a MySQL database:

  • Backup
  • Clean-up binary logs
  • Optimize tables
  • Purge query cache
  • Rotate binary logs

Backup

A backup is not a typical maintenance job. But it behaves more or less like one. The backup should be done regularly depending on the restore/PITR (Point in Time Recovery) requirements.

Make sure, that in the backup all the necessary files (data files, transaction log files, configuration files and binary log files) are included. To prove that …

My thoughts about MySQL (Cluster) replication

According to Johans wishes I write down my concerns about MySQL (Cluster) replication. These items are things I run again and again into it with customers:

  • SQL-nodes are still loosing too easy connection to cluster after data node or management node restart (which leads into gaps, see next point). Automatic failover or reconnection is just a dream (maybe it works in about 90% of the cases at least).
  • Gaps: Whenever I do a cluster reconfiguration (should not be necessary too often, see loosing connection …

With MySQL-Enterprise Montior through firewalls

Sometimes it is nice to show customers the functionality of MySQL-Enterprise Monitor (aka Merlin). I install the agents on the servers and the dashboard runs on my laptop. But very often only ssh is open to these servers.

So how to dig a whole through the firewall for MySQL-Enterprise Monitor?

# ssh -R 18080:localhost:18080 oli@where_the_agent_sits

Maybe trivial for you but for me its hard to remember…

Ranking in MySQL results

A friend of me asked me long time ago: “How can I have a ranking on a result with MySQL?”. Now I found some time to write it down:

Lets do first some preparation for the example:

CREATE TABLE sales (
  id     INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, fruit  VARCHAR(32)
, amount DECIMAL
);

INSERT INTO sales
VALUES (NULL, 'apple', 12.75), (NULL, 'orange', 1.89), (NULL, 'pear', 19.23)
     , (NULL, 'banana', 4.25), (NULL, 'cherry', 123.75), (NULL, 'plum', 23.15)
;

Now lets query:

SELECT …
tags: 

MySQL logon trigger

With MySQL 5.0 the database provides trigger functionality on INSERT, REPLACE, UPDATE and DELETE.

Those of you who know some other RDBMS know, that there are also some system events where one would like to have triggers.

Unfortunately MySQL does not (yet) provide such functionality. This is sad because as database administrator this would be sometimes very helpful.

But you can build your own LOGON and STARTUP trigger.

MySQL provides some hooks for these events…

Complete Story (PDF 160 kbyte).

MySQL Cluster restore

Recently the question came up if it is faster to restore a MySQL cluster when all nodes are up or only ONE node from each node group during restore.

The answer from our gurus was: All nodes up during restore! I wanted to find out why. So I set up the following cluster and started to measure:

MySQL Cluster set up

Cluster set-up

MySQL Cluster backup

The backup is not that interesting. But I made the drawing for possible future use :-) :

Backup

MySQL Cluster restore

For the restore there are 4 different ways thinkable:

  • Restore …

MySQL Active - Active Clustering

It is possible to use an active - active shared-disk cluster in MySQL in some cases. For doing this you have to fulfill the following requirements:

  • Works with MyISAM tables only.
  • POSIX-locking compliant cluster file system on the device (such as OCFS2 or GFS).
  • External locking must be enabled.
  • The MySQL query cache must be turned off.
  • The MySQL delay key write must be turned off.
  • OS where file locking is supported in MySQL.

External Locking

Interested? To read more, follow the link: MySQL active - active Cluster (PDF 157 …

Round-Robin Database Storage Engine (RRD)

In a round-robin database (RRD) usually time-series data like network bandwidth, temperatures, CPU load etc. is stored. The data is stored in the way that system storage footprint remains constant over time. This avoids resource expensive purge jobs and reduces complexity.

RRD

MySQL does NOT yet provide this kind of storage engine. Although some people were thinking about and some prototypes exists.

Nevertheless in this paper it is shown how you can build your own RRD tables: Round-Robin Database Storage …

Profiling MySQL with oprofile

Probably the answer to this question is already known. But we want to prove it and by the way learn to deal with MySQL and oprofile.

Materialized Views (MV) with MySQL

Materialised View (MV) is the pre-calculated (materialised) result of a query. Unlike a simple VIEW the result of a Materialised View is stored somewhere, generally in a table. Materialised Views are used when immediate response is needed and the query where the Materialised View bases on would take to long to produce a result. Materialised Views have to be refreshed once in a while. It depends on the requirements how often a Materialised View is refreshed and how actual its content is. Basically a …

Some more benchmarks added

We have added some more database benchmarks to our collection.

More details you can find on our Benchmarking page.

MySQL storage engines

One of the big advantages of MySQL is its concept of pluggable Storage Engines (SE). This means you can choose the most optimal storage engine for your needs. This also has a disadvantage: You have to know what you are doing…

More details you can find here: MySQL pluggable Storage Engines (SE).

Stealthy migrating MySQL tables and MySQL data access interfaces using enlarged updateable VIEW functionality

Applications occasionally require redesign. However, redesigning an application cannot be done in one step because the application is distributed or several versions of applications must be supported. MySQL 5.0 provides the necessary means to stealthy migrate your data. In a short overview let’s look at what we plan to do: Stealthy Migration (PDF 98.7 kByte).

Subscribe to RSS - Mysql