Book Image

Getting Started with MariaDB

By : Daniel Bartholomew
Book Image

Getting Started with MariaDB

By: Daniel Bartholomew

Overview of this book

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.
Table of Contents (16 chapters)
Getting Started with MariaDB Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
MariaDB Next Steps
Index

Backing up, importing, and restoring data


MariaDB ships with a couple of utilities that can be used to back up our databases. Data in MariaDB is written to special files on disk, so it may be tempting to think that we can just make a copy of the MariaDB data directory and be done with it. The problem with this is that the data files are always open and in use while MariaDB is running and problems can arise if we try to back up the files directly. At the end of this section, we will describe a method for taking backups of the data directory, but first, we'll go over conventional backup techniques.

Basic backups with mysqldump

By default, the mysqldump client backup utility generates SQL backups. These backups are in a text format and contain all the necessary SQL commands to recreate tables and restore the data in those tables.

There are many options, but the basic syntax is as follows:

mysqldump [-u username] [-p] database_name [table_name]

If table_name is not given, mysqldump will back up...