Showing entries 11 to 20 of 133
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: 5.7 (reset)
Migrate from MariaDB to MySQL on CentOS

On this article, I will show you how to migrate your wordpress database from the MariaDB on CentOS to the real MySQL.

Why migrating to MySQL 8.0 ?

MySQL 8.0 brings a lot of new features. These features make MySQL database much more secure (like new authentication, secure password policies and management, …) and fault tolerant (new data dictionary), more powerful (new redo log design, less contention, extreme scale out of InnoDB, …), better operation management (SQL Roles, instant add columns), many (but really many!) replication enhancements and native group replication… and finally many cool stuff like the new Document Store, the new MySQL Shell and MySQL InnoDB Cluster that you should already know if you follow this …

[Read more]
Friday Feb 1st it is MySQL Day !

We are less than 48h before the more and more popular pre-FOSDEM MySQL Day !

Unfortunately one of our speaker won’t be able to deliver his talk. Indeed, Giuseppe had ton cancel is talk on containers (Automating MySQL operations with containers) but he will be present during the day and during the Community Dinner, so if you have questions, I’m sure he will gladly answer them.

So we have replace this great speaker by another great one: Shlomi Noach !

Shlomi will present a very new session: Un-split brain (aka Move Back in Time) MySQL.

Here is the updated …

[Read more]
MySQL InnoDB Cluster with 2 Data Centers for Disaster Recovery: howto – part 2

In the first part of this howto, I illustrated how to setup two MySQL InnoDB Cluster linked by an asynchronous replication.

In that solution, I didn’t use any replication filters to ignore the replication of the InnoDB Cluster’s metadata (mysql_innodb_cluster_metadata), but I used the same metadata tables with two different clusters in it.

The benefit is that this allows to backup everything from any node in any of the data center, it works also in MySQL 5.7, and there is not risk to mess up with the replication filters.

In this blog I will show how to use replication filters to link two different clusters. This doesn’t work on …

[Read more]
MySQL Memory Consumption and Open Prepare Statements

Today I read the nice post of Bhuvanesh on the memory leak issue they experienced with MySQL. In fact when you read the post, you realize that MySQL was just following the parameters that were setup (the default of max_prepare_stmt_count is 16382 even on 5.6).

I’m still convinced that the problem should be resolved in the application even if the use of ProxySQL for multiplexing is great.

In MySQL 8.0, we have enabled the …

[Read more]
MySQL: when will the password of my users expire ?

Has you may already know, in MySQL it is possible to set an expiration period for passwords.

It’s not always obvious to see when the password will expire. And most of the time if you don’t pay much attention you will get something like this:

ERROR 1820 (HY000): You must reset your password using
ALTER USER statement before executing this statement.

Let me share you a small query that check for how long your password is still valid in case it was created with an expiration delay or if the global default_password_lifetime is set on …

[Read more]
MySQL: size of your tables – tricks and tips

Many of you already know how to retrieve the size of your dataset, schemas and tables in MySQL.

To summarize, below are the different queries you can run:

Dataset Size

I the past I was using something like this :

But now with sys schema being installed by default, I encourage you to use some of the formatting functions provided with it. The query to calculate the dataset is now:

SELECT sys.format_bytes(sum(data_length)) DATA,
       sys.format_bytes(sum(index_length)) INDEXES,
       sys.format_bytes(sum(data_length + index_length)) 'TOTAL SIZE'
FROM information_schema.TABLES ORDER  BY data_length + index_length;

Let’s see an example:

[Read more]
How to know if a user never connected to the MySQL server since last boot ?

Performance_Schema is used most of the time to get metrics about queries and connections. But it can also provide other very useful information.

So today, I will show you how you can see a list of users that didn’t connect to MySQL since we restarted it (since last reboot).

SELECT DISTINCT mu.user FROM mysql.user mu
LEFT JOIN performance_schema.users psu
ON mu.user = psu.user
WHERE psu.user IS NULL
AND mu.user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys')
ORDER BY mu.user;

Example:

mysql> SELECT DISTINCT mu.user FROM mysql.user mu
    ->       LEFT JOIN performance_schema.users psu 
    ->       ON mu.user = psu.user  
    ->       AND mu.user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys')
    -> …
[Read more]
MySQL Router HA with Keepalived

After having explained how to achieve HA for MySQL Router for people who doesn’t want to install the MySQL Router on the application servers and after having illustrated how to use Pacemaker, this article explains how to setup HA for MySQL Router using keepalived.

Keepalived is very popular, maybe because it’s also very easy to use. We can of course use 2 or more servers. The principle is the same as on the previous articles, if the router dies, the virtual IP used by the application server(s) to connect to MySQL is sent to another machine where mysqlrouter is still running.

Let’s have a look at the configuration, in this case we use 2 machines, mysql1 and …

[Read more]
MySQL Router HA with Pacemaker

This article will explain how to setup HA for MySQL Router as described in a previous article about where should the router stand.

For this setup, I will use Pacemaker (part of RedHat High Availability Add-on and available on RHEL, CentOS, Oracle Linux, …).

Of course we need a MySQL InnoDB Cluster but we won’t really use it for the HA setup of the MySQL Router.

Installing Pacemaker

The first step is to install pacemaker on all the machines we will use for our “MySQL Router Cluster”:

# yum install pacemaker pcs resource-agents

Now we need to start the pcsd service and enable it at boot (on all machines):

# systemctl start pcsd.service 
# systemctl enable pcsd.service

It’s time now to setup authentication, this operation is again …

[Read more]
MySQL InnoDB Cluster: is the router a single point of failure ?

As you know, MySQL InnoDB Cluster is composed of 3 elements:

  • a group replication cluster of at least 3 servers
  • the MySQL Shell used to manage the cluster
  • the MySQL Router that send the traffic from the application server(s) to the cluster

When presenting the solution in conferences, one the main question is Where should I put the router ? and the answer is always the same: the best place to install the router is the application server !

The router is a very lightweight process that gets its configuration from the cluster’s metadata and doesn’t require a lot of resources or maintenance.

So the ideal setup is the following:

However for many (obscure?) reasons, sometimes people doesn’t want to have the MySQL …

[Read more]
Showing entries 11 to 20 of 133
« 10 Newer Entries | 10 Older Entries »