Running and Managing MySQL in Docker Containers

MySQL Database Overview MySQL is a widely-used open-source relational database management system, favored for its performance, reliability, and ease of use, particularly in small to medium-sized web applications. Official Docker Image The official MySQL Docker image is available at: https://hub.docker.com/_/mysql. Deploying a MySQL Container St ...

Posted on Sun, 27 Sep 2026 16:51:54 +0000 by chrishawkins

Solving Inventory Over-Selling with Locking Mechanisms and Distributed Locks

Understanding the Root Cause: Inventory Over-Selling A classic inventory over-selling issue arises when multiple conucrrent requests decrement stock without proper synchronization. Consider a scenario where product inventory is stored in MySQL, and the stock reduction logic is implemented as follows: @Service public class StockService { @A ...

Posted on Sun, 27 Sep 2026 16:51:05 +0000 by Diceman

Efficient Data Migration from MySQL to MongoDB Sharded Clusters Using Python

This implementation focuses on migrating MySQL data to a MongoDB sharded cluster using Python, with adaptations for older MongoDB 3.4 APIs and enhancements for multithreading and streaming. The original code from an open-source repository has been modified to support concurrent processing and compatibility with PyMongo's legacy methods. import ...

Posted on Sun, 27 Sep 2026 16:04:10 +0000 by php_joe

Managing MySQL Data Persistence with Docker Named Volumes

Docker containers are ephemeral by design, meaning any data written to the container's writable layer is discarded when the instance stops. To preserve stateful information like database records, Docker provides volumes. While anonymous volumes are generated automatically, they are difficult to track and migrate. Named volumes offer a declarati ...

Posted on Sat, 26 Sep 2026 16:19:36 +0000 by jkrettek

Pivoting Monthly Revenue Rows into Columns with Conditional Aggregation

CREATE TABLE dept_income ( dept_id INT, mon VARCHAR(3), income INT ); INSERT INTO dept_income VALUES (1,'Jan',8000),(1,'Feb',7000),(1,'Mar',6000), (2,'Jan',9000),(2,'Feb',8000),(2,'Mar',7000); The goal is to transform the above row-oriented data into a single row per department with twelve monthly columns. Why GROUP BY ...

Posted on Fri, 25 Sep 2026 16:10:25 +0000 by ipwnzphp

MySQL Data Synchronization Using canal-server and canal-adapter

Roles and Functions Role Function canal-server Listens to the source database and captures data changes. canal-adapter Subscribes to canal-server and writes data to the target database. Deploying canal-server For detailed steps on deploying canal-server in a Kubernetes cluster, refer to official documentation. A new instance must be ...

Posted on Thu, 24 Sep 2026 16:31:23 +0000 by amit

Install MySQL on Linux

Installation process for MySQL database on Linux systems 1. Install the database Use the command: yum -y install mysql-server (simple method) This command automatically searches for the MySQL service resource from the internet, downloads it to the local system, and completes the installation. Alternatively, download the MySQL service from t ...

Posted on Thu, 24 Sep 2026 16:28:10 +0000 by syngod

MySQL Database Fundamentals: DDL, DML, Indexing, and Query Optimization

SQL serves as the universal language for interacting with relational database systems. While implementations vary across vendors, MySQL adheres closely to the ANSI/ISO SQL standard while extending it with practical enhancements for performance, usability, and developer productivity. Core SQL Language Categories SQL operations are logically grou ...

Posted on Wed, 23 Sep 2026 16:28:40 +0000 by swimmerphil1

Retrieving and Parsing JSON Fields from MySQL using JDBC

Establishing a JDBC ConnectionTo interact with the database, initialize a connection object using the JDBC driver manager. Ensure the connection string specifies the correct host, port, and schema.String connectionString = "jdbc:mysql://localhost:3306/inventory_db"; String dbUser = "app_user"; String dbPass = "secure_pass"; try (Connection dbL ...

Posted on Tue, 22 Sep 2026 16:51:26 +0000 by nesargha

Installing MySQL 5.7 on Windows and Changing the Root Password

Downloading MySQL 5.7 Begin by downloading the MySQL 5.7 installer from the official MySQL Community Downloads archive. Navigate to the following URL and select a version from the 5.7.x series. https://downloads.mysql.com/archives/community/ Manual Installation Steps 2.1 Extracting and Configuring Environment Variables After downloading the arc ...

Posted on Tue, 22 Sep 2026 16:40:49 +0000 by jalapena