Showing entries 1 to 10 of 1252
10 Older Entries »
Displaying posts with tag: Databases (reset)
How to Manage MySQL Databases and Users from the Command Line

MySQL is the most popular database server used by websites to store their important data. In addition to using phpMyAdmin ...

Read More

The post How to Manage MySQL Databases and Users from the Command Line appeared first on RoseHosting.

Database testing for all version changes (including minor versions)

We know that SQL statement compatibility can change with major database version upgrades and that you should adequately test for them. But what about minor version upgrades?

It is dangerous to assume that your existing SQL statements work with a minor update, especially when using an augmented version of an open-source database such as a cloud provider that may not be as transparent about all changes.

While I have always found reading the release notes an important step in architectural principles over the decades, many organizations skip over this principle and get caught off guard when there are no dedicated DBAs and architects in the engineering workforce.

Real-world examples of minor version upgrade issues

Here are two real-world situations common in the AWS RDS ecosystem using MySQL.

  1. You are an organization that uses RDS Aurora MySQL for its production systems, and you upgrade one minor version …
[Read more]
Are you patching your AWS RDS MySQL 5.7 EOL databases?

Recently, I noticed a second AWS RDS MySQL 5.7 version available 5.7.44-rds.20240408. Curious what this was as 5.7.44 is the only RDS 5.7.x EOL version available, I launched an instance to discount this as errant metadata.

Today I noticed a second version 5.7.44-rds.20240529. I do not run a MySQL 5.7 AWS RDS instance or pay the AWS Extended Support tax, so I would not receive any notices or recommendations that customers may be receiving.

Image generated by ChatGPT. Mistakes left as a reminder genAI is not there yet for text.

I needed to do some searching before I found a reference here and then this …

[Read more]
The curse of MySQL warnings

MySQL warnings are an anti-pattern when it comes to maintaining data integrity. When the information retrieved from a database does not match what was entered, and this is not identified immediately, this can be permanently lost.

MySQL by default for several decades until the most recent versions enabled you to insert incorrect data, or insert data that was then truncated, or other patterns that resulted in failed data integrity. Very few applications considered handling warnings as errors, and there is a generation of software products that have never informed the developers that warnings were occurring.

The most simplest example is:

CREATE SCHEMA IF NOT EXISTS warnings;
USE warnings;

CREATE TABLE short_name(
  id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  name VARCHAR(20) NOT NULL,
  PRIMARY KEY(id)
);

INSERT INTO short_name (name) VALUES ('This name is too long and will get truncated');
ERROR 1406 (22001): Data too long for …
[Read more]
Mastering MySQL 5.7 EOL migrations

In a recent podcast on Mastering EOL Migrations: Lessons learned from MySQL 5.7 to 8.0 I discuss with my colleague Adam North not only the technical issues that become a major migration but also key business and management requirements with having a well-articulated strategy that covers:

  • Planning
  • Testing
  • Be Prepared
  • Proactiveness

Having a plan is key to any significant task including data migrations. You should heed the warnings and the deprecations and consider all potential downstream product impacts such as connector upgrades. The plan includes a timeline but also needs to define all the stakeholders both technical and business, the definition of a successful migration, and most importantly the decision tree for a non-successful migration that would …

[Read more]
Upgrading GitHub.com to MySQL 8.0

Over 15 years ago, GitHub started as a Ruby on Rails application with a single MySQL database. Since then, GitHub has evolved its MySQL architecture to meet the scaling and resiliency needs of the platform—including building for high availability, implementing testing automation, and partitioning the data. Today, MySQL remains a core part of GitHub’s infrastructure and our relational database of choice.

This is the story of how we upgraded our fleet of 1200+ MySQL hosts to 8.0. Upgrading the fleet with no impact to our Service Level Objectives (SLO) was no small feat–planning, testing and the upgrade itself took over a year and …

[Read more]
How to Install MySQL on AlmaLinux

In this tutorial, we’ll be going over every step of how to install MySQL on AlmaLinux. Database servers are the ...

Read More

The post How to Install MySQL on AlmaLinux appeared first on RoseHosting.

How To Fix Corrupted Tables in MySQL

In this blog post, we are going to show you how to fix corrupted tables in MySQL. MySQL is an ...

Read More

The post How To Fix Corrupted Tables in MySQL appeared first on RoseHosting.

10 Useful mysqladmin Commands for Database Administration

In this blog post, we will show you ten useful mysqladmin commands for database administration. Mysqladmin is a client for ...

Read More

The post 10 Useful mysqladmin Commands for Database Administration appeared first on RoseHosting.

Creating a ColdFusion UUID in MySQL

The uuid() function in MySQL returns a 36 character hex string, formatted as:

aa479ea9-1d9d-11ed-ba03-564760fe47b7

ColdFusion's createUUID() function returns a 35 character hex string formatted as:

AA479EA9-1D9D-11ED-BA03564760FE47B7

Both store the same amount of data (16 bytes), the only difference is that there is an extra dash in the MySQL uuid() function result.

Here's some SQL I came up with to create a UUID using ColdFusion's formatting in raw SQL:

SELECT upper(concat(left(uuid(), 23), right(uuid(), 12)))

It is not an ideal solution because I am actually calling uuid() twice, but it is sufficient for my use case. You could probably use a regex to remove the extra dash and avoid calling uuid twice if you wanted to try and optimize it. Feel free to post a comment if you can come up with a better way to do it.

Now suppose you want …

[Read more]
Showing entries 1 to 10 of 1252
10 Older Entries »