Skip to Content
MySQL Cookbook, 3rd Edition
book

MySQL Cookbook, 3rd Edition

by Paul DuBois
August 2014
Intermediate to advanced
866 pages
24h 4m
English
O'Reilly Media, Inc.
Content preview from MySQL Cookbook, 3rd Edition

Chapter 23. Security

Introduction

This chapter covers security-related topics:

  • The mysql.user table that contains MySQL account information

  • Statements for managing MySQL user accounts

  • Password strength checking and policy

  • Password expiration

  • Finding and fixing insecure accounts

  • Finding and removing anonymous accounts and accounts that permit connections from many hosts

If you like, you can skip over the initial section that describes the mysql.user table, but I think you’ll find that reading it will help you better understand later sections, which often discuss how SQL operations map onto underlying changes in that table.

Scripts shown in this chapter are located in the routines directory of the recipes distribution.

Note

Whether you use the MySQL 5.5, 5.6, or 5.7 release series, it is best to use a recent version within the series. Changes to the authentication system occur in early development versions that may produce results that differ from the descriptions here.

Note

Many of the techniques shown here require administrative access, such as the ability to modify tables in the mysql system database or use statements that require the SUPER privilege. For this reason, to carry out the operations described here, connect to the server as root rather than as cbuser.

Understanding the mysql.user Table

MySQL stores user account information in tables in the mysql system database. The user table is the most important because it contains account names and credentials. To see its structure, use this statement: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook, 4th Edition

MySQL Cookbook, 4th Edition

Sveta Smirnova, Alkin Tezuysal
SQL Cookbook, 2nd Edition

SQL Cookbook, 2nd Edition

Anthony Molinaro, Robert de Graaf

Publisher Resources

ISBN: 9781449374112Errata PageSupplemental Content