What is MySQL (and MariaDB)?

Databases explained simply: what MySQL and MariaDB store, how tables, users and privileges work, and how a website uses them.

ExplainerBeginner2 min readUpdated

A database stores information in an organised way so an application can find, sort and update it quickly. MySQL and its close relative MariaDB are the most widely used databases for websites.

What goes in a website’s database

  • Posts, pages and products
  • User accounts and hashed passwords
  • Comments and orders
  • Settings

Uploaded images and the application’s code are files, not database content.

The structure

  • Database — a container for one application’s data, e.g. username_wp
  • Tables — like spreadsheets: posts, users, options
  • Rows — one record each
  • Columns — fields such as title or email

Users and privileges

An application connects with a database user and password. The user has privileges on specific databases. Give each application its own user with access only to its own database. Managing database users and privileges

On Traxio

SQL

Applications talk to databases in SQL:

SELECT title FROM posts WHERE status = 'published' ORDER BY created_at DESC LIMIT 5;

You don’t need to know SQL to run WordPress; it helps when troubleshooting.

Looking for somewhere to run PHP and MySQL? Traxio’s free PHP MySQL hosting includes phpMyAdmin and is free for your first 30 days.

New to Traxio? Hosting is 30 days free with no card needed, then £0.99 a month. See what’s included

Popular

Tip: press / to search from any pageSee all results