From time to time people wonder how to implement roles in MySQL.
This can be useful for companies having to deal with many user
accounts or for companies with tight security requirements (PCI
or HIPAA for instance). Roles do not exist in regular MySQL but
here is an example on how to emulate them using Percona Server,
the PAM plugin and proxy users.

The goal

Say we have 2 databases: db1 and db2, and we want to be able to
create 3 roles:

DBAs often encounter situations where they need to kill queries
to ensure there are no long-running queries on a MySQL server
that would impact performance. Long-running queries can be the
result of many factors. Fortunately, Percona Server contains some handy tools to remove
problematic MySQL processes. I will highlight all of the tools
via some examples in this post.

pt-kill:
There have been some good posts on this blog about the pt-kill
tool, like this one by Arunjith Aravindan titled “ …

If you use Percona Server 5.5 and you have configured it to use
multiple buffer pool instances than sooner or later you’ll see
the following lines on the server’s error log and chances are
you’ll be worried about them:

MySQL introduced the Event Scheduler in version 5.1.6. The Event
Scheduler is a MySQL-level “cron
job”, which will run events inside MySQL. Up until now, this
was not a very popular feature, however, it has gotten more
popular since the adoption of Amazon RDS – as well as similar MySQL database
as a service offerings where there is no OS …

Global Transaction IDs (GTIDs) are one of my favorite features of
MySQL 5.6. The main limitation is that you must stop all the
servers at the same time to allow GTID-replication. Not everyone
can afford to take a downtime so this requirement has been a
showstopper for many people. Starting with Percona Server
5.6.22-72.0 enabling GTID replication can be done without almost
no downtime. Let’s see how to do it.

Being a QA Engineer, how would you feel if you had access to a
framework which can generate 80+ crashes – a mix of hitting
developer introduced assertions (situations that should not
happen), and serious unforeseen binary crashes – for the
world’s most popular open source database software – each and
ever hour? What if you could do this running on a medium spec
machine – even a laptop?

The seniors amongst you may object “But… generating a crash or
assertion is one thing – creating a repeatable testcase for the
same is quite another.”

MySQL 5.6 allows you to execute replicated events in parallel as
long as data is split across several databases. This feature is
named “Multi-Threaded Slave” (MTS) and it is easy to enable by
setting slave_parallel_workers to a > 1 value.
However if you decide to use MTS without GTIDs, you may run into
annoying issues. Let’s look at two of them.

Skipping replication errors

When replication stops with an error, a frequent approach is to
“ignore now and fix later.” This means you will run SET
GLOBAL sql_slave_skip_counter=1 to be able to restart
replication as quickly as possible and …

Mydumper is known as the faster (much faster) mysqldump
alternative. So, if you take a logical backup you will choose
Mydumper instead of mysqldump. But what about the restore? Well,
who needs to restore a logical backup? It takes ages! Even with
Myloader. But this could change just a bit if we are able
to take advantage of Fast Index Creation.

As you probably know, Mydumper and mysqldump export the struct of
a table, with all the indexes and the constraints, and of course,
the data. Then, Myloader and MySQL import the struct of the table
and import the data. The most important difference is that you
can configure Myloader to …

As a MySQL DBA/consultant, it is part of my job to decode the
MySQL binary logs – and there are a number of reasons for doing
that. In this post, I’ll explain how you can get the important
information about your write workload using MySQL row-based
binary logs and a simple awk script.

First, it is important to understand that row-based binary logs
contain the actual changes done by a query. For example, if I run
a delete query against a table, the binary log will contain the
rows that were deleted. MySQL provides the mysqlbinlog utility to
decode the events stored in MySQL binary logs. You can read more
about …

The other day a customer asked me to do capacity planning for
their web server farm. I was looking at the CPU graph for one of
the web servers that had Hyper-threading switched
ON and thought to myself: “This must be quite a
misleading graph – it shows 30% CPU usage. It can’t really be
that this server can handle 3 times more work?”

Or can it?

I decided to do what we usually do in such case – I decided to
test it and find out the truth. Turns out – there’s more to it
than meets the eye.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.