Book Image

MariaDB Cookbook

By : Daniel Bartholomew
Book Image

MariaDB Cookbook

By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Securing MariaDB with mysql_secure_installation


The simplest way to add a bit of extra security to our MariaDB installation is just a command line away.

How to do it...

To secure a default install of MariaDB, perform the following steps:

  1. Open a terminal and run the following command:

    mysql_secure_installation
    
  2. As prompted by the script, set a password for the root user, disallow remote root logins, and remove anonymous users.

  3. Since we've been using the test database for various recipes in the current and other chapters, we may not want to remove it when prompted.

  4. Reload the privilege tables when prompted.

How it works...

The mysql_secure_installation program is actually just a script written in PERL. Its sole purpose is to apply some basic security settings that nearly every MariaDB installation should have. This script should be run first thing after installing MariaDB on a server. It takes only a minute and should be considered as an essential step that we must perform whenever we install MariaDB...