Deploying High-Availability Multi-Master MySQL NDB Clusters with MySQL Cluster Manager

Traditional MySQL replication architectures (active-passive or source-replica topologies) introduce replication lag and require failover orchestrators (e.g., Orchestrator or ProxySQL) to handle master crashes. MySQL NDB Cluster is a shared-nothing, distributed database that provides real-time in-memory performance, 99.999% high availability, and active-active multi-master read/write capabilities across all SQL nodes. This guide details configuring and scaling a multi-master NDB cluster using Oracle MySQL Cluster Manager (MCM). Core Architecture & Node Roles An NDB cluster consists of three distinct node types: ...

September 5, 2017 · 3 min · 528 words · Ahmad Mahfouz

Docker Persistent Storage for MySQL with SELinux Enforcement

Running stateful services like MySQL inside Docker containers requires mapping data volumes to host storage. On enterprise Linux distributions running SELinux in enforcing mode (such as Red Hat Enterprise Linux, CentOS, or Fedora), containerized processes are isolated using Type Enforcement and Multi-Category Security (MCS). If the host directory lacks the appropriate SELinux context and file permissions, the MySQL daemon will encounter Permission denied errors during database initialization. 1. Pull the Official MySQL Image Retrieve the official MySQL container image from Docker Hub: ...

July 16, 2016 · 3 min · 457 words · Ahmad Mahfouz

Fixing phpMyAdmin Error #1146: Table 'phpmyadmin.pma_tracking' Doesn't Exist

When navigating through phpMyAdmin, you may encounter the following error: #1146 - Table 'phpmyadmin.pma_tracking' doesn't exist Figure 1: Missing internal configuration storage tables in phpMyAdmin. This error indicates that phpMyAdmin’s internal metadata and configuration storage database (phpmyadmin) was either skipped during initial package installation or failed to execute its SQL initialization scripts. Solution 1: Reconfigure via dpkg-reconfigure (Recommended) On Debian and Ubuntu systems, the cleanest method to repair the metadata database is using dbconfig-common via dpkg-reconfigure: ...

June 26, 2016 · 1 min · 204 words · Ahmad Mahfouz

Enabling Passwordless Login in phpMyAdmin for Local Development

When configuring a local development environment (such as on a virtual machine or local development container) where MySQL root has an empty password, phpMyAdmin blocks authentication attempts by default with the following error: Login without a password is forbidden by configuration (see AllowNoPassword) This security safeguard prevents accidental deployment of passwordless database instances in publicly accessible environments. Enabling Empty Passwords in config.inc.php To enable passwordless authentication for local sandbox testing, modify the phpMyAdmin configuration file: ...

June 26, 2016 · 1 min · 153 words · Ahmad Mahfouz

Bypassing Foreign Key Constraints for Table Deletion in MySQL

When maintaining or purging relational data in MySQL and MariaDB, deleting rows from a parent table that are referenced by existing foreign keys in child tables triggers a constraint violation error: ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails While referential integrity is essential during standard application execution, administrative migrations, database seeding, or emergency data cleanup frequently require temporarily suspending constraint validation. Suspending Constraint Checks To allow MySQL to delete or truncate rows without evaluating foreign key dependencies, disable FOREIGN_KEY_CHECKS in the active database session: ...

December 13, 2014 · 1 min · 197 words · Ahmad Mahfouz

Automation: Creating UTF-8 MySQL Databases and Users via Python

When provisioning new web applications or services, setting up clean UTF-8 databases and isolating access permissions to dedicated application users is a routine administrative task. Using the proper character set (utf8mb4 in modern MySQL, or utf8 in legacy environments) prevents multi-byte character encoding errors and collation mismatches. The Standard SQL Provisioning Queries The standard sequence to create an application database with UTF-8 support and grant least-privilege permissions to a dedicated user is: ...

November 24, 2014 · 2 min · 357 words · Ahmad Mahfouz

Resetting MySQL and MariaDB Root Passwords

Locked out of MySQL with ERROR 1045 (28000): Access denied for user 'root'@'localhost'? When root credentials are lost or desynchronized, you cannot change the password while the daemon enforces standard privileges. You must restart the database daemon in a bypass mode, update the authentication tables, and restart the service normally. Here are two reliable methods to recover access. Method 1: Using --skip-grant-tables This method starts the daemon without reading the grant tables, allowing local root login without a password. ...

November 24, 2014 · 2 min · 234 words · Ahmad Mahfouz