November 2026
Every post published in November 2026, newest first. Pick a day to jump straight to it.
- Posts
- 1,837
- Topics
- 113
- Reading time
- 190 h
- Active days
- 20
Posts 1,801–1,830 of 1,837 · November 2–3, 2026
Page 61 of 62
Tuesday, November 3, 2026
16 of 91 posts
Fixed: "error CA1861: Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array" in an EF Core Migration
A new EF Core migration with a two-column index stopped a .NET 10 build with error CA1861. EF Core writes the index columns as a constant array, and the migration file isn't treated as generated code, so the recommended analysis rules and TreatWarningsAsErrors fail the build. Turn CA1861 off for migration files only, as the rule's own page allows for code that runs once.
9 min readFixed: "Authentication to host '127.0.0.1' for user 'inventory_app' using method 'caching_sha2_password' failed with message: Access denied for user 'inventory_app'@'172.20.0.1' (using password: YES)" in .NET
A .NET C# app failed to open a MySQL connection with MySqlException: Authentication to host failed with message: Access denied for user (using password: YES). How to read each part of the message, why MySQL saw 172.20.0.1 instead of localhost with Docker, and how I confirmed the cause was the password in the connection string.
7 min readFixed: "Unable to connect to any of the specified MySQL hosts" in .NET C#
A .NET C# program failed with MySqlException "Unable to connect to any of the specified MySQL hosts" and SocketException "Connection refused": once because the connection string had the wrong port, once because MySQL was stopped. Here's how to tell which part of the path is broken, in four checks, on macOS, Linux and Windows.
7 min readFixed: "Retrieval of the RSA public key is not enabled for insecure connections" Connecting .NET C# to MySQL
A .NET C# program failed to connect to MySQL 9.7 with "Retrieval of the RSA public key is not enabled for insecure connections" when SslMode was Disabled, then worked with the same settings a minute later. Here's why the caching_sha2_password cache makes it come and go, why AllowPublicKeyRetrieval is the wrong fix, and the right one.
8 min readFixed: "Incorrect integer value: 'Adjustment' for column 'Type' at row 3" When Reverting an EF Core Migration on MySQL
Reverting an EF Core migration that stored an enum as a string failed on MySQL with "Incorrect integer value: 'Adjustment' for column 'Type' at row 3": the generated Down method turns the column back into an int while it holds names. Here's how to make Down convert the names back to numbers first.
7 min readFixed: "Cannot drop index 'IX_stock_movements_ProductId': needed in a foreign key constraint" in an EF Core Migration on MySQL
Adding a two-column index that starts with a foreign key column produced an EF Core migration that drops the old foreign key index first, and MySQL refused with error 1553. Here's why the order matters, and how to swap two calls in Up and Down so the migration applies and reverts cleanly.
7 min readFixed: "BLOB, TEXT, GEOMETRY or JSON column 'Description' can't have a default value" When Making an EF Core Column Required on MySQL
Making a nullable string property required in EF Core produced a migration with DEFAULT '' for a longtext column, which MySQL rejects with error 1101. Here's why EF Core adds that default, what MySQL allows instead, and how to edit the migration so existing NULLs are filled and the column becomes NOT NULL.
8 min readFixed: "Data too long for column 'Name' at row 2" When Applying an EF Core Migration to MySQL
An EF Core migration that shortened a text column from longtext to varchar(200) failed on MySQL with "Data too long for column 'Name' at row 2", and left the table half-changed. Here's how to find the long values, see what the failed migration already did, fix the data and apply the migration cleanly.
8 min readFixed: "ERROR 1146 (42S02): Table 'inventory.Products' doesn't exist" in MySQL
A query for Products failed with ERROR 1146 although the table was right there as products. MySQL on Linux and in Docker compares table names case-sensitively. Here's how to check lower_case_table_names, find the real name, and keep EF Core table names lowercase so code works on every platform.
6 min readFixed: "ERROR 1264 (22003): Out of range value for column 'UnitPrice' at row 1" in MySQL
MySQL refused a price with ERROR 1264 because the number had more digits before the decimal point than the DECIMAL column allows. Here's how to read a column's precision and scale, find its exact limit, why too many decimals only round while too many whole digits fail, and how to fix the column or the input from EF Core and .NET C#.
8 min readFixed: "ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails" in MySQL
An insert into a MySQL products table failed with ERROR 1452 because I guessed a category's Id, and AUTO_INCREMENT gaps made the guess wrong. Here's how to read the message, find the right parent Id, insert safely by looking it up, and return 400 Bad Request from a .NET C# API with EF Core.
7 min readFixed: "ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails" in MySQL
Deleting a category in MySQL failed with ERROR 1451 because products still referenced it through a foreign key with ON DELETE RESTRICT. Here's how to read the message, find the rows that block the delete, move or remove them, and return 409 Conflict from a .NET C# API with EF Core.
8 min readFixed: "ERROR 1062 (23000): Duplicate entry 'adapters' for key 'categories.IX_categories_Name'" in MySQL
MySQL rejected a new category called 'adapters' as a duplicate of 'Adapters' with ERROR 1062, because the column's collation ignores case. Here's how to read the message, choose between case-insensitive and case-sensitive uniqueness, upsert with ON DUPLICATE KEY UPDATE, and return 409 Conflict from a .NET C# API.
8 min readFixed: "ERROR 3819 (HY000): Check constraint 'CK_products_UnitPrice' is violated." in MySQL
MySQL refused an EF Core migration with "Check constraint 'CK_products_QuantityOnHand' is violated.", and later refused a negative price with ERROR 3819. Here's how to find the rows that break the rule, fix them, apply the constraint, and turn the error into a clean 400 response in a .NET C# Web API.
8 min readFixed: "ERROR 1064 (42000): You have an error in your SQL syntax … near 'IF NOT EXISTS(SELECT * FROM `__EFMigrationsHistory`'" in an EF Core Idempotent Migration Script
An EF Core idempotent migration script made by dotnet ef migrations script --idempotent failed in MySQL 9.7 with ERROR 1064 at its first IF NOT EXISTS block. Oracle's MySql.EntityFrameworkCore provider writes SQL Server-style IF … BEGIN … END blocks, which MySQL only accepts inside stored programs. Generate the script from the database's last applied migration instead, and it runs.
13 min readFixed: "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate" in Python on macOS
A Python script on macOS failed to open an HTTPS address with ssl.SSLCertVerificationError: CERTIFICATE_VERIFY_FAILED, unable to get local issuer certificate, while curl opened it fine. Python from python.org uses its own OpenSSL without the Mac's certificates; its Install Certificates script fixes it. Shown on Python 3.15.2.
7 min read
Monday, November 2, 2026
14 of 21 posts
How to Connect a .NET C# Web API to a MySQL Database — Part 1: Connect with EF Core and a Secure Connection String
Connect an ASP.NET Core minimal Web API in .NET 10 and C# to MySQL 9.7 with EF Core 10 and Oracle's MySql.EntityFrameworkCore provider. Install the packages, write the DbContext, keep the connection string in user-secrets, require TLS, retry short outages and prove the connection with a readiness health check, then watch the same connection from inside MySQL.
44 min readHow to Add Liveness and Readiness Health Checks to a .NET C# Web API
Add /health/live and /health/ready endpoints to an ASP.NET Core minimal API in .NET 10 and C#: AddHealthChecks, MapHealthChecks, tags and predicates, and an EF Core database check with AddDbContextCheck. See the real 200 and 503 answers when the database goes down and comes back.
9 min readHow to Store a Connection String in .NET C# with dotnet user-secrets
Keep a database connection string and its password out of appsettings.json and out of Git with .NET's Secret Manager: dotnet user-secrets init, set, list, remove and clear, where the secrets file lives, why it's read in Development only, and how the same setting reaches the app as an environment variable everywhere else.
12 min readHow to Create a .NET C# Web API Solution with a Class Library
Create a production-ready .NET 10 C# solution from the command line: an .slnx solution, global.json, shared build rules in Directory.Build.props, central package management, an ASP.NET Core minimal Web API project and a class library that it references. Includes the two errors the strict settings raise on the template, and how to fix them.
19 min readHow to Stop, Start and Remove Docker Compose Containers Without Losing Data
Learn which Docker Compose commands keep your data and which one deletes it: docker compose stop, start, down and up keep a database's named volume, while down -v removes it. Shown live with MySQL 9.7, including proof the data survived.
7 min readHow to Check if a MySQL Connection Uses TLS
Check whether your MySQL connection is encrypted with the status command and the Ssl_cipher and Ssl_version session variables, understand why a Unix socket shows SSL Not in use, make the mysql client require TLS with --ssl-mode=REQUIRED, and check an application's connection in the Performance Schema. Real output from MySQL 9.7.
8 min readHow to Check the MySQL Character Set and Collation
Check the character set and collation of your MySQL server, database and connection, understand what utf8mb4 and utf8mb4_0900_ai_ci mean, and see real proof of accent- and case-insensitive comparisons in MySQL 9.7. Includes the latin1 surprise in Docker's mysql client.
8 min readHow to Check the MySQL Version
Five ways to see exactly which MySQL version you run: SELECT VERSION(), the client's welcome banner, SHOW VARIABLES LIKE 'version%', the status command, and mysqld --version without signing in. Plus why a Docker image tag isn't the exact version. Real output from MySQL 9.7.4.
6 min readHow to Connect to MySQL in a Docker Container with the mysql Client
Open the mysql command-line client that ships inside the official MySQL Docker image with docker compose exec, sign in safely, run your first queries, run a single query or a whole .sql file without staying in, and leave. No MySQL install on your computer. Real output from MySQL 9.7.
11 min readHow to Run MySQL in Docker with Docker Compose
Run MySQL 9.7 LTS on any computer with Docker Desktop: one compose.yaml with a named data volume, a health check, a port only your own computer can reach, and passwords kept in a .env file. Every line explained, with real output from the first start.
15 min readHow to Keep Passwords Out of compose.yaml with an .env File
Keep database passwords out of compose.yaml and out of Git: reference them as ${VARIABLE} with :? so Docker Compose refuses to start without them, store the real values in a git-ignored .env file, and commit a safe .env.example instead. Real output from Docker Compose v5.
8 min readHow to Generate a Strong Random Password in the Terminal
Generate a cryptographically random password with one command, using openssl rand -hex on macOS and Linux and .NET's RandomNumberGenerator in Windows PowerShell, and write it straight into a .env file without it ever appearing on screen.
6 min readHow to Add a .gitignore to a .NET C# Project
Create Microsoft's ready-made .gitignore for .NET and C# with dotnet new gitignore, see what it keeps out of Git (bin, obj, .vs, .env and more), and prove a file is ignored with git check-ignore and git status --ignored. Real output from .NET 10.
6 min readHow to Create a Git Repository and Make Your First Commit
Turn any project folder into a Git repository with git init -b main, then stage and commit your files with git add and git commit, step by step, with real output on Git 2.56 and the same commands for macOS, Linux and Windows.
8 min read