Skip to main content
GrN.dk

Main navigation

  • Articles
  • Cases
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Drupal 7 on MySQL 8: Fixing the NO_AUTO_CREATE_USER Error

By Greg Nowak. Last updated 2026-07-15.

A Drupal 7 site that fails after a move to MySQL 8 can produce an intimidating SQLSTATE[42000] message about NO_AUTO_CREATE_USER. The immediate cause is usually straightforward: Drupal is asking MySQL to enable an SQL mode that the database no longer recognises.

The technical fix can be small. The operational decision is larger. In 2026, Drupal 7 is no longer community supported, so this incident should produce two outcomes: a controlled recovery now and a documented decision about how long the platform should remain in service.

What the error actually means

MySQL removed NO_AUTO_CREATE_USER in version 8.0.11. Its upgrade documentation advises removing the value from server configuration and older dump files as well as application-generated settings.

Drupal addressed this as part of its wider MySQL 8 compatibility work in Drupal 7.76. That work also added quoting for identifiers such as the system table, whose name conflicts with MySQL 8 syntax. This is why deleting one string from a patched core file is an incomplete solution: later Drupal 7 releases contain related compatibility changes that a one-line edit does not provide.

Diagnose before changing production

Start by confirming the versions that are actually running. Do not rely only on a hosting dashboard or an old handover document. Check the deployed code and query the database connection used by the application.

grep "define('VERSION'" includes/bootstrap.inc
SELECT VERSION();
SELECT @@SESSION.sql_mode;
SELECT @@GLOBAL.sql_mode;

Before deploying a change, take a fresh database backup, retain the current code release and confirm that somebody can perform the rollback. A backup that has never been restored is reassurance, not yet a recovery plan.

What you find Likely explanation Practical next action
Drupal is older than 7.76 Core predates Drupal’s MySQL 8 compatibility work Test an update using the final community release or the baseline supplied by your extended-support provider
Drupal is exactly 7.76 It includes MySQL 8 support but also introduced a table-prefix regression Do not stop at 7.76; review the 7.77 hotfix and move to an appropriate later baseline
Current legacy core still sends the removed mode A proxy or managed service may be reporting the server version incorrectly Confirm the reported version, then consider a targeted connection override
The failure occurs during server startup or database restore An option file, deployment script or older dump may still contain the mode Remove the obsolete value at its source rather than changing Drupal alone
A quick decision matrix for separating a Drupal core problem from an infrastructure problem.

Use the final community release as the minimum reference point

Drupal 7.76 introduced MySQL 8 support, and 7.77 immediately followed with a hotfix for table prefixes containing dots. The final community release was Drupal 7.103, published in December 2024.

That does not make 7.103 supported today. It makes it a more credible starting point than a much older release with an isolated community patch. If the site has commercial extended support, follow that provider’s maintained distribution and update process instead. In either case, compare custom core modifications before replacing files; old Drupal estates often contain undocumented edits.

When the settings.php override is justified

If the deployed core already contains the MySQL 8 work but Drupal still builds the wrong mode, investigate how the server version reaches PHP. Drupal’s change record notes reports involving managed services and proxies that returned misleading version information.

After confirming that situation, a per-connection override in settings.php is a reasonable containment measure:

$databases['default']['default']['init_commands']['sql_mode'] =
  'SET SESSION sql_mode="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"';

Adding the named command avoids replacing unrelated entries if init_commands already exists. Keep the override in version-controlled configuration, comment on why it is necessary and record which infrastructure behaviour it compensates for. If the provider later corrects its version reporting, reassess the workaround instead of letting it become permanent folklore.

Do not disable MySQL identifier quoting as a routine MySQL 8 fix. Quoting was part of Drupal’s compatibility work. The old empty-string workaround documented by Drupal was intended for particular problems on older MySQL installations, not as a default setting for MySQL 8.

Test the business paths, not just the homepage

A successful homepage request proves only that Drupal can bootstrap. The release should also cover login, content editing, cache clearing, cron, search and file handling. Add the site’s revenue or service-critical journeys: checkout, lead forms, account creation, API synchronisation and scheduled exports.

Capture the deployed core version, database version, effective session mode, configuration change, test results and rollback location in the incident record. That gives the next engineer something better than an error screenshot and prevents the same investigation from being repeated.

Treat recovery and migration as separate workstreams

Drupal 7 reached end of life on January 5, 2025. Community releases, security coverage and compatibility updates have ended. A stable MySQL connection therefore solves today’s outage, but it does not restore an ongoing support path.

Once service is stable, decide who owns the legacy risk, whether extended support is required and when migration discovery will begin. That discovery should inventory custom modules, integrations, content types, editorial workflows and data-retention requirements before anyone estimates a rebuild.

If you need a second pair of eyes, Greg can help separate the immediate Drupal recovery from the migration decision and turn both into a workable delivery plan. Talk to Greg about the next step.

Related on GrN.dk

  • NGINX 1.30 changed upstream connection reuse by default: what to check before you upgrade
  • Fix the HTTPRL Network Configuration Error in Drupal 7
  • MariaDB 10.6 EOL: quiet CMS hosting debt needs a real upgrade plan before July 2026

Need help with this kind of work?

Discuss your Drupal recovery plan Get in touch with Greg.

Sources

  • MySQL 8 Support on Drupal 7
  • Drupal 7.77 release notes
  • Drupal 7.103 release notes
  • Drupal 7 has reached end of life
  • Changes in MySQL 8.0
Last modified
2026-07-15

Tags

  • Drupal
  • Drupal 7
  • MySQL 8
  • Legacy website support
  • Website migration

Review Greg on Google

Greg Nowak Google Reviews

 

Illustrated infographic summarizing: Shorter TLS certificates expose every renewal you never automated
Shorter TLS certificates expose every renewal you never automated
2026-07-26

Shorter TLS lifetimes leave less room for manual handoffs and faulty deploy hooks. Build a renewal path that protects service availability.

Illustrated infographic summarizing: One Timeout, Two Orders: Make AI Actions Safe to Retry
One Timeout, Two Orders: Make AI Actions Safe to Retry
2026-07-25

A timed-out AI action may already have succeeded. Stable keys, durable ledgers, queues and stored results prevent a routine retry from duplicating real work.

Illustrated infographic summarizing: Your AI Visibility Dashboard Needs a Methodology, Not More Charts
Your AI Visibility Dashboard Needs a Methodology, Not More Charts
2026-07-24

A practical framework for measuring AI-search visibility with fixed prompts, repeated tests, separate metrics, retained evidence, and honest reporting.

Illustrated infographic summarizing: AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
2026-07-23

New AI admin APIs can automate access and spend controls, but reliable governance still starts with authoritative directory data and clear ownership.

Illustrated infographic summarizing: OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
2026-07-22

Before an AI agent can take on real work, its workflow needs clear scope, permissions, handoffs, evaluation cases, and production monitoring.

Illustrated infographic summarizing: Chatbot Transcripts Quietly Became a Retention and Redaction Problem
Chatbot Transcripts Quietly Became a Retention and Redaction Problem
2026-07-21

Chatbot transcripts spread across providers, logs and support tools. Here is how to map each copy, redact sensitive data and test deletion properly.

Illustrated infographic summarizing: Cloudflare Service Keys Stop in September: Find Every Caller
Cloudflare Service Keys Stop in September: Find Every Caller
2026-07-20

Cloudflare Service Keys stop working on September 30, 2026. Here is how to find every caller, move to scoped API tokens and avoid a late outage.

Illustrated infographic summarizing: Your AI Workflow Needs an Acceptance Test Before It Meets Customers
Your AI Workflow Needs an Acceptance Test Before It Meets Customers
2026-07-19

A practical way to test AI workflows using realistic scenarios, tool checks, human rubrics, regression suites, and clear release gates.

Three cover candidates for The Goats Were Load-Bearing fanned on a dark background: an ember-lit door, three slow knocks, and a founders' ledger
The Goats Were Load-Bearing: a fantasy where the bill always comes due
2026-07-19

A teaser for the upcoming darkly comic fantasy novel The Goats Were Load-Bearing — a village, a door that must stay poor, and the worst possible time to sell the herd. Readers pick the cover.

Vegan Power game: the yellow player catches falling fruit while a chicken and a cow look on
Vegan Power: The Little Game About Eating Fruit, Not Friends
2026-07-19

Vegan Power is a free browser game where you catch fruit, dodge the animals, protect seven hearts, and chase a better high score.

More articles
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.