MySQL is a client/server relational database. A mysqld server stores data; clients (mysql, PHP PDO, Laravel Eloquent) connect and send SQL.
Core characteristics
- InnoDB default — ACID transactions, row-level locking, foreign keys
- Replication — primary/replica topologies for read scaling and HA
- Wide hosting — shared hosting, managed RDS/Aurora, PlanetScale
- SQL dialect — mostly ANSI with MySQL-specific functions and limits
Server, database, table
SHOW DATABASES;
USE practice;
SHOW TABLES;
DESCRIBE customers;Practice: Copy SQL into the mysql client, local MySQL/MariaDB, or DB Fiddle (MySQL dialect).
Who uses MySQL?
WordPress, Magento, many Laravel apps, legacy LAMP stacks, and startups on managed MySQL. Postgres is common for greenfield SaaS—see PostgreSQL track for comparison.
Important interview questions and answers
- Q: Default storage engine today?
A: InnoDB—transactions and foreign keys; avoid MyISAM for new apps. - Q: Schema vs database in MySQL?
A: MySQL uses DATABASE where Postgres says schema for namespace—naming trips up migrations.
Self-check
- Name the default transactional engine.
- What command lists tables in the current database?
Tip: Default engine is InnoDB—verify with SHOW TABLE STATUS.
Interview prep
- Default engine?
InnoDB—transactions, row locks, foreign keys.
- DESCRIBE?
Shows column names, types, nullability, keys for a table.