Showing entries 1 to 10 of 139
10 Older Entries »
Displaying posts with tag: MySQL 8 (reset)
Making my MySQL InnoDB Cluster safe from naughtiness

TL;DR: Make sure to run “SET persist_only disabled_storage_engines=’MyISAM’, persist sql_generate_invisible_primary_key=ON;” on all instances and restart each one in your MySQL InnoDB Cluster.

Ok, what does “safe from naughtiness” mean?:
– Anyone creating tables that aren’t InnoDB, as this doesn’t make sense, after all, it is an “InnoDB” cluster.
– Making sure all tables have a Primary Key (invisible or not).
– Making sure that my (invisible) primary keys are visible to the cluster as it will rightfully complain if they aren’t!

This basically means that once you’ve got it all up and running you won’t run into those horrible situations whereby someone, somewhere, creates a MyISAM table that didn’t have a Primary Key and thus leave you with a broken cluster.

Eg.

MySQL rtnode-01:3306 ssl JS > vlc.status()
{
 "clusterName": "VLC",
 "clusterRole": "PRIMARY", …
[Read more]
Observing InnoDB Cluster: A different approach for specific info extraction

Now this is far from being any observability manual for your InnoDB Cluster and let alone go into everything MySQL Shell API Admin, or the collectDiagnostics utility. You can also use the default javascript commands that we all know and love via dba.getCluster() and so on, but here’s a different take.

I just want to share something I’ve been playing with to pull out some key info from mycluster. Hope it helps someone else out there.

General setup:

select cluster_id, cluster_name, description, cluster_type, primary_mode, clusterset_id
from mysql_innodb_cluster_metadata.clusters;

Members of our cluster:

select * from …
[Read more]
Learning SQL Exercise

I’ve been using Alan Beaulieu’s Learning SQL to teach my SQL Development class with MySQL 8. It’s a great book overall but Chapter 12 lacks a complete exercise. Here’s all that the author provides to the reader. This is inadequate for most readers to work with to solve the concept of a transaction.

Exercise 12-1

Generate a unit of work to transfer $50 from account 123 to account 789. You will need to insert two rows into the transaction table and update two rows in the account table. Use the following table definitions/data:

                      Account:
account_id     avail_balance    last_activity_date
-----------    --------------   ------------------
       123               450    2019-07-10 20:53:27
       789               125    2019-06-22 15:18:35

                      Transaction:
txn_id    txn_date      account_id    txn_type_cd    amount
------    ----------    -------+--    -----------    ------
  1001 …
[Read more]
Galera Manager March 2024 Release now includes UI improvements and a SSH console tab

Codership is please to announce a new release of Galera Manager. This brings the installer to version 1.13.0 (you can check this by typing: ./gm-installer version which will report gm-installer version 1.13.0 (linux/amd64)) and the actual Galera Manager GUI to 1.8.4. Users will notice many usability improvements, and multiple fixes for issues filed at the galera-manager-support issue tracker.

The biggest facing user items in this release include a “jobs” tracker. It can be a flat list or a hierarchical view, and you will notice that this is not just for a cluster wide view, but also for individual nodes. Naturally on the left hand menu, you will also see Jobs listed there; this is to show jobs that do not belong to any cluster.

[Read more]
Parametric Queries

In 2021, I wrote a MySQL example for my class on the usefulness of Common Table Expressions (CTEs). When discussing the original post, I would comment on how you could extend the last example to build a parametric reporting table.

Somebody finally asked for a concrete example. So, this explains how to build a sample MySQL parametric query by leveraging a filter cross join and tests the parameter use with a Python script.

You can build this in any database you prefer but I used a studentdb database with the sakila sample database installed. I’ve granted privileges to both databases to the student user. The following SQL is required for the example:

-- Conditionally drop the levels table.
DROP TABLE IF EXISTS levels;
 
-- Create the levels list.
CREATE TABLE levels
( level_id       int unsigned primary key auto_increment
, …
[Read more]
Installing Galera Cluster 4 with MySQL on Ubuntu 22.04

We have in the past covered Installing Galera Cluster 4 with MySQL 8 on Ubuntu 18.04 and also Installing Galera 4 with MySQL 8 on Ubuntu 20.04, and it would seem appropriate to also cover Ubuntu 22.04 LTS (Jammy Jellyfish). We do have excellent documentation and we also have the ability for you to automate all of this via the GUI tool, Galera Manager.

Prerequisites

  • All 3 nodes have to have Ubuntu 22.04 LTS installed. The current version at the time of this writing is Ubuntu 22.04.3 LTS.
  • Firewall (if setup) needs to …
[Read more]
Ruby+MySQL on Ubuntu

This post goes through installing and configuring Ruby and Ruby on Rails for MySQL. The first step requires updating the Ubuntu OS:

sudo apt-get update

Interestingly, I found that the man-db service had inadvertently stopped. It raised the following error:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

You run this command to find the problem with the dpkg utility:

sudo dpkg --configure -a

It returned:

Setting up man-db (2.10.2-1) ...
Updating database of manual pages ...
man-db.service is a disabled or a static unit not running, not starting it.

The following command started the man-db service:

sudo systemctl start man-db.service

Next, you install the prerequisite packages with this command:

sudo apt-get install -y git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev …
[Read more]
Deploying a Percona XtraDB Cluster (PXC) with Galera Manager automatically on Amazon Web Services

Galera Manager supports three modes for supporting your Percona XtraDB Clusters: deploying to either Amazon Web Services, deploying to your own on premises hosts, and also just monitoring your clusters. In this blog post, we will go thru houw you should deploying a 3-node Percona XtraDB Cluster via Galera Manager on Amazon Web Services Elastic Compute Cloud (AWS EC2). You will realise that this process happens with just a simple API key and instance selection, so effectively you can have a Galera Manager setup in under fifteen minutes!

On AWS EC2, it is worth noting that Galera Manager itself can be deployed on the free tier for testing purposes. However, in production environments, you might expect up to 100GB of logs on a monthly basis, so you should plan accordingly.

Obtain Galera Manager by …

[Read more]
Galera Manager January 2024 release

The momentum around Galera Manager development has been amazing. You report bugs or feature requests, and we fix them!

The major reason to release this was to ensure that Galera Manager would accept the new signing keys of Galera Cluster (key ID: 8DA84635).

One will now also note that gm-installer reports a new version: gm-installer version 1.12.0 (linux/amd64). And when you install it, Galera Manager itself is now at version 1.8.3. One of the major fixes is that Ubuntu 22.04 support for self-provided hosts is now exposed in the UI. This fixes …

[Read more]
Ubuntu, Perl & MySQL

Configuring Perl to work with MySQL is straight forward. While Perl is installed generally, you may need to install the libdbd-mysql-perl library.

You install it as a sudoer user with this syntax:

sudo apt install -y libdbd-mysql-perl

Display detailed console log

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libmysqlclient21
The following NEW packages will be installed:
  libdbd-mysql-perl libmysqlclient21
0 upgraded, 2 newly installed, 0 to remove and 12 not upgraded.
Need to get 1,389 kB of archives.
After this operation, 7,143 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libmysqlclient21 amd64 8.0.35-0ubuntu0.22.04.1 [1,301 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libdbd-mysql-perl amd64 …
[Read more]
Showing entries 1 to 10 of 139
10 Older Entries »