MySQL Installation & Setup
In this page:
Preparing for Installation
Before installing, confirm you're downloading the correct MySQL build for your operating system and CPU architecture, since mixing an incompatible installer with your OS is the most common source of setup failures. Free up a few hundred megabytes of disk space beforehand too.
Example: Preparing for Installation
-- Confirm the installer matches your OS and CPU architecture before running it
Choosing the Right Edition
MySQL Community Edition is the free, fully-featured version most developers and small teams use, while Enterprise Edition adds paid extras like advanced auditing, backup tooling, and official support contracts aimed at large organizations with compliance requirements.
Example: Choosing the Right Edition
-- MySQL Community Edition (free) vs Enterprise Edition (paid, extra tooling)
Verifying the Installation
After installing, connect with a client (the command line, Workbench, or a code library) and run a trivial query like SELECT 1 to confirm the server actually responds — a clean install can still fail to start if a port conflict or permissions issue exists.
Example: Verifying the Installation
SELECT 1;
Initial Server Configuration
The installer lets you pick the default storage engine (almost always InnoDB today, for its transaction and foreign-key support) and the server's timezone setting, which affects how TIMESTAMP columns are interpreted and displayed later.
Example: Initial Server Configuration
CREATE TABLE test (id INT) ENGINE=InnoDB;
SET time_zone = '+00:00';
Securing the Installation
Security hardening during setup mainly means setting a strong root password and, ideally, running the mysql_secure_installation script to remove default test databases and anonymous-user accounts that ship enabled by default.
Example: Securing the Installation
-- Run mysql_secure_installation after setup to remove test databases and anonymous users
ALTER USER 'root'@'localhost' IDENTIFIED BY 'StrongPassword!23';
Chapter Quiz — Complete all 8 topics to unlock
0/8 topics done
Complete these topics first: