The most popular relational database for the web is MySQL. It’s a free open source project that has been around for years so it’s definitely worth learning.
But there’s also many levels of MySQL from basic web development to server administration, scaling, and maintaining distributed systems. You can learn all of these topics by reading the right books and in this post I’ve curated the best titles for all skill levels.
Anyone brand new to MySQL should grab a copy of Murach’s MySQL. It teaches you everything about the MySQL engine from the ground-up and it’s my top recommendation for complete beginners who have never touched a database in their life. With a well-organized lesson plan and simple writing this book appeals to everyone regardless of background.
To understand MySQL you also need to understand how databases work and how they’re structured. That’s exactly what you’ll get with MySQL Explained: Your Step By Step Guide.
It offers a complete overview of relational database systems including how data is stored and generally how data tables work. Early chapters also explain the benefits of MySQL and why it’s such a great engine to pick up.
You can work through this book without any prior knowledge of MySQL or any database knowledge. Although it does help if you’ve got some experience working on the web or using SQL.
Still this is one of the better guides for complete beginners because it’s brand new, up to date, and reliable with a bunch of great information.
Whether you want to work on the sysadmin side or the web development side this is a brilliant introduction to the world of MySQL management.
Here’s another brilliant intro guide for beginners teaching how MySQL works from the ground up.
Murach’s MySQL is a fairly lengthy book totaling 600+ pages and a lot of easy-to-read code snippets. It also uses a lot of diagrams to grab your attention and keep it fixed on the overall structure of relational DBs.
Each chapter follows in a logical order of steps where you’ll learn how to install MySQL, how to use the MySQL Workbench, add/retrieve data from a table, and how to perform more technical SQL queries.
While working through these lessons you’ll realize how knowledge builds with each chapter. This makes it an easy book to work through and internalize regardless of your existing background.
For a quick reference guide this is surprisingly dense with 580+ pages of guides and tutorials.
MySQL in a Nutshell is both portable and easy to work through despite it’s massive size. The book is very detailed offering a clearer view inside the MySQL management setup. I wish it was a bit more organized as a reference guide, but the index is clean enough that you can find your way around.
The chapters follow a simple progression from installation to basic setup, security, adding users, adding tables, stored routines and so much more.
Naturally this targets a less-knowledgeable audience so you don’t need to know anything about MySQL to get started.
All you need is some time and patience to work through the lessons, all of which should be pretty simple given the clear writing style.
If you’re looking for a portable book then this is the one you’ll want. MySQL Pocket Reference is short, sweet, and straight to the point with coverage for all the key features in a MySQL setup.
It’s mostly geared towards LAMP stacks but the pocket reference is ultimately agnostic on the tech stack. If offers guided tips for setting up new users, configuring MySQL, custom searches, and working with the raw SQL syntax.
Learning the ropes comes with practice and you won’t find a ton of practice in this book. Instead think of it like a reference guide to keep handy if you ever want to pull up some ideas or work through lessons quicker.
Later chapters can get pretty detailed with stored cursors and procedures so don’t think of this as just a newbie’s reference. It can be very handy for experienced sysadmins too and it’s the perfect book to keep nearby if your systems are ever offline and you need to look up a solution without Internet access.
Problems are a cornerstone of system administration. The goal isn’t to avoid problems entirely, but rather to solve them quickly whenever they pop up.
MySQL Troubleshooting looks at common problems from DBAs and system administrators. It’ll teach you how to write operating SQL code and how to solve issues when that code doesn’t work.
You’ll find all the most common and not-so-common problems covered in great detail within these pages. The book spans a whopping 260 pages with a ton of code samples and problem solving techniques.
Learn how to fix problematic queries, avoid SQL injection, and how to salvage a corrupted database. Other topics cover the differences in operating systems and how these environments can cause different problems with your MySQL install.
This book is mostly geared towards professionals who already know a bit about MySQL and want a reference guide for problem solving.
This is one of the newest books in my list and it’s also one of the cheapest you can find.
With only 70 pages MySQL Introduction doesn’t offer much of an introduction. But it is a brilliant first step for anyone who wants to dive into database structures without having any prior knowledge.
A big technical book can scare off people who don’t understand what it’s about or how to use it. But MySQL isn’t much of a complicated topic, and this book proves that anyone can learn it given the right tools.
You’ll learn how to setup MySQL on a Linux and Windows machine along with building on the command line, plus executing more advanced techniques through the GUI.
Solid intro for a beginner who doesn’t want to commit a lot to larger coding books.
Sasha Pachev used to work as a core developer on the MySQL team and he wrote Understanding MySQL Internals as a guide to the entire system.
In this book you’ll learn how MySQL operates from the inside-out. You’ll dive into its open source codebase to study the core classes and methodologies of the MySQL 5 engine.
Over the course of a few chapters you’ll learn how the database connects to a server and how this connection shares data back and forth. You’ll also dig into the variables and custom controls on the MySQL engine with tricks on how you can build your own extensions.
This is much more of a learning guide than a how-to manual so don’t expect it to guide you very far. Still it’s an excellent book to sink your teeth deep into the internals of a MySQL setup.
Once you get past the basics you may want to pick up on some of the newer features in MySQL 5.x. This includes stored procedures which are encapsulated SQL queries that perform a very specific task.
You’ll learn how to build these yourself in MySQL Stored Procedure Programming. It’s a pretty sizable book with 640 pages and tons of practical exercises.
Executing code on the database server may seem intimidating if you’ve never done this before. However I specifically recommend this book to bring yourself into a whole new level of understanding SQL code.
Professional DBAs and sysadmins understand how stored procedures can drastically improve the common workflow. But if you’re just teaching yourself this might not make sense until you actually try it, and this book is perfect for that task.
Anyone who runs a business knows that data is absolutely essential. This data can include customer information or it can be sales pricing or inventory stock.
Learning MySQL: Get a Handle on Your Data looks into data storage from the perspective of business development. You’ll learn how to manage databases and how to design custom dashboards for querying information at the drop of a hat.
All three major operating systems are covered including a lot of basic SQL code. Automated backups, database security, and improving DB efficiency are all topics discussed in this book.
One downside to this book is the index that seems to lack a lot of organization. It won’t be easy to look up functions or SQL calls directly, and instead you’ll need to search by topics.
But this is one minor issue compared to this massive book on data management and MySQL development, great for techies and entrepreneurs alike.
When you get into high volume queries you need to consider performance and how to get the most out of MySQL.
A lot of this has to do with the server environment, caching, and the SQL queries, but they all relate to the MySQL engine. MySQL High Availability talks about all these subjects explaining some common tricks to improve performance.
MySQL replications, clusters, and custom monitoring features are all considered. You’ll also learn how to deal with outages and the benefits of using a physical server instead of a virtual machine(and vice-versa).
All the authors on this book are practiced engineers who have real insights to scaling a MySQL setup. Learning to mitigate risk is not easy but with techniques covering redundancy and data replication this book is the perfect guide for it.
Here’s another guide on performance that I find a little more straightforward. This one’s also a tad larger with 830 pages, but still teaches a lot of the fundamentals for scaling.
High Performance MySQL is probably a better choice for beginner-to-intermediate users because the topic is covered in a simplistic manner. You’ll learn about how security concerns affect performance and what you can do to keep your system safe.
This also delves into more complex topics like partitioned databases and RAID setups. No matter what OS you’re running there’s always a different workflow and this book covers them all.
I’d rate this as an easier intro book for MySQL performance since it teaches you the fundamental ideas of a performant database and how to achieve this yourself.
If you’re willing to work through these lessons you’ll come out the other side incredibly confident in your MySQL abilities.
One of the best reasons to learn MySQL is to work on the LAMP stack. This runs on Linux servers with an Apache webhost using PHP for the backend and MySQL for the database.
Still I find this book incredibly valuable for anyone looking to learn practical MySQL. Most of the time you’ll learn about database setups and sharding, then ask yourself what it all means.
With this book you’ll find real web applications you can build yourself and learn PHP/MySQL connections in the process. Easily one of the best books I can recommend for newbie developers or sysadmins who want to dive into coding for the web.
Working as a database administrator is no easy task. The job pays well but it often comes with sporadic hours and stress when problems arise.
The MySQL Administrator’s Bible will help you keep some sanity and deal with the inevitable problems that arise from complex database solutions. This book totals almost 900 pages starting with the basic fundamentals of MySQL administration.
From there you’ll get into much more complex topics like multi-DB setups, triggers and views, transactions, and local caching. Recovery backup systems are also covered in detail because data is the single asset you’re in charge of protecting.
Security and backups are two huge topics in this book and you’ll learn a lot just from those chapters. But overall this book is a godsend for aspiring MySQL admins and it’s especially valuable for anyone looking at this as a career path.
Currently in its 3rd edition the MySQL Cookbook is one of the best desk references around. It’ll prove invaluable the more you work in MySQL and find yourself searching the web for solutions.
This cookbook has been through many iterations covering a whole swath of problems, along with the varying solutions used to fix them. You’ll learn how to populate and backup database tables along with connecting into many different web servers(plus automating those tasks).
Import/export recipes are also included to help you save time when migrating. Other recipes cover web input, stored routines, and security patching.
Almost anything you could ever want to learn is covered in this book. However it’s written as a problem/solution guide without much focus on the learning process.
This is best used by developers who already know MySQL and just want a solid desk reference for solving common(or not-so-common) issues.
This cookbook is a tad smaller but also much more focused. The High Availability MySQL Cookbook spans 270 pages with over 60 recipes you can use in your project work.
Note this cookbook only considers high availability concepts to reduce downtime and improve security on your MySQL setup.
It’s not really useful for programmers who use shared hosting or managed hosting. You will not be working directly with MySQL and you wouldn’t even have much control anyways.
However if you’re going the dedicated/VPS route then this book has a treasure trove of goodies.
Each recipe looks at a specific task and offers a very careful series of instructions. The goal is to help you learn how high availability SQL works and what you need to do for the best performance on your server.
Definitely another cool desk guide but I think this one’s really most useful for professionals working on larger projects.
MySQL is a big area with a lot to learn. But it’s also one of the best database engines to start with.
If you’re just getting into this topic I recommend Murach’s MySQL for a technical look into all the fundamentals. Or if you want to start off simpler check out MySQL Explained which is also made for complete beginners.
Once you get past the basics you’ll find a ton of other relevant books scattered throughout this post. Take another look over the list and see if any specific titles stand out.