You are previewing Getting Started with MariaDB - Second Edition.
O'Reilly logo
Getting Started with MariaDB - Second Edition

Book Description

Explore the powerful features of MariaDB with practical examples

In Detail

MariaDB is a database that has become very popular in the few short years that it has been around. It does not require a big server or expensive support contract. It is also powerful enough to be the database of choice for some of the biggest and most popular websites in the world, taking full advantage of the latest computing hardware available.

From installing and configuring through basic usage and maintenance, each chapter in this revised and expanded guide leads on sequentially and logically from the one before it, introducing topics in their natural order so you learn what you need, when you need it. The book is based on the latest release of MariaDB and covers all the latest features and functions. By the end of this beginner-friendly book, not only will you have a running installation of MariaDB, but you will have practical, hands-on experience in the basics of how to install, configure, administer, use, and maintain it.

What You Will Learn

  • Install MariaBD on Windows, Mac OS X, and Linux

  • Configure MariaDB for better performance using the features of version 10

  • Get familiar with the usage of operators for retrieving rows more selectively

  • Use MariaDB 10's powerful tools to store, retrieve, and analyze data

  • Secure MariaDB from unauthorized access

  • Maintain the databases associated with MariaDB to ensure efficient and optimum functioning

  • Retrieve data and learn how to sort, summarize, group, and manipulate it.

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. Getting Started with MariaDB Second Edition
      1. Table of Contents
      2. Getting Started with MariaDB Second Edition
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Installing MariaDB
        1. Choosing a MariaDB series
          1. The development series
          2. The stable series
          3. The maintenance series
        2. Installing MariaDB on Windows
        3. Installing MariaDB on Mac OS X
        4. Installing MariaDB on Debian, Ubuntu, and Linux Mint
        5. Installing MariaDB on Fedora, Red Hat, and CentOS
        6. Installing MariaDB on other Linux distributions
        7. MariaDB package security
        8. After the installation
        9. Troubleshooting installation issues
        10. Summary
      9. 2. Configuring MariaDB
        1. The MariaDB filesystem layout
          1. The MariaDB filesystem layout on Windows
          2. The MariaDB filesystem layout on Linux
        2. Modular configuration on Linux
        3. The anatomy of the MariaDB configuration file
          1. Where is my configuration file?
          3. Groups
          4. Options that do not require values
          5. Options that require values
          6. Option formatting
          7. Options, options everywhere
        4. Activating configuration changes
        5. Summary
      10. 3. Securing MariaDB
        1. Security layers
        2. Securing MariaDB in 10 seconds
        3. Connecting safely
          1. Connecting safely on the command line
          2. Connecting safely in scripts
        4. Server security
        5. Building security
        6. Internal network security
        7. Internet security
        8. Summary
      11. 4. Administering MariaDB
        1. User privileges
          1. Global administrative user privileges
          2. Database, table, and column user privileges
          3. Miscellaneous user privileges and limits
        2. Creating users
        3. Granting, revoking, and showing permissions
          1. Granting permissions
          2. Revoking permissions
          3. Showing permissions
        4. Setting and changing passwords
        5. Removing users
        6. Summary
      12. 5. Using MariaDB – Databases and Tables
        1. The mysql command-line client application
        2. Connecting to MariaDB
        3. Using USE to select a database
        4. Using SHOW to list all databases on a server
        5. Creating and deleting databases
          1. Using CREATE DATABASE to create a database
          2. Using DROP DATABASE to delete a database
        6. Data, tables, and normalization
        7. Creating, altering, and dropping tables
          1. Using CREATE TABLE
            1. Using CREATE TABLE – basic syntax
            2. Using CREATE TABLE – datatypes
            3. Using CREATE TABLE– other options
            4. Using CREATE TABLE – an example
            5. Using SHOW to display the command used to create a table
            6. Using DESCRIBE to explore the structure of a table
          2. Using ALTER TABLE
            1. Using ALTER TABLE – basic syntax
            2. Using ALTER TABLE – adding a column
            3. Using ALTER TABLE – modifying a column
            4. Using ALTER TABLE – dropping a column
          3. Using DROP TABLE
        8. Summary
      13. 6. Using MariaDB – Inserting, Updating, and Deleting
        1. Using INSERT
          1. Inserting complete rows
          2. Inserting partial rows
          3. Inserting from another table
          4. Inserting from a file
        2. Using UPDATE
        3. Using DELETE
        4. Summary
      14. 7. Using MariaDB – Retrieving Data
        1. Retrieving data
          1. Retrieving everything
          2. Retrieving selected columns
        2. Filtering and searching data
          1. Filtering by exact values
          2. Using logical operators
            1. Using the AND operator
            2. Using the OR operator
            3. Evaluation order
            4. Using the IN operator
            5. Using the NOT operator
          3. Searching with LIKE
          4. Sorting data
          5. Joining data
        3. Summarizing data
          1. The AVG function
          2. The COUNT function
          3. The MIN and MAX functions
          4. The SUM function
          5. Using GROUP BY with summarized data
          6. Using HAVING to filter GROUP BY
        4. Summary
      15. 8. Maintaining MariaDB
        1. MariaDB log files
          1. The binary log
          2. The error log
          3. The general query log
          4. The slow query log
        2. Optimizing and tuning MariaDB
        3. Backing up, importing, and restoring data
          1. Basic backups with mysqldump
          2. Restoring backups made with mysqldump
          3. Making tab-delimited backups with mysqldump
          4. Restoring and importing data with mysqlimport
          5. Making backups of MyISAM tables with mysqlhotcopy
          6. Making backups of XtraDB and InnoDB tables with xtrabackup
          7. Restoring backups made with xtrabackup
          8. Making cold backups
        4. Repairing MariaDB
          1. Checking and optimizing tables with mysqlcheck
          2. Repairing tables
        5. Summary
      16. A. MariaDB Next Steps
      17. Index