Book Image

Getting Started with MariaDB

By : Daniel Bartholomew
Book Image

Getting Started with MariaDB

By: Daniel Bartholomew

Overview of this book

<p>In the modern age, storing data is of paramount importance, and this is where databases enter the picture. MariaDB is a relatively new database that has become very popular in a short amount of time. It is a community-developed fork of MySQL and it is designed to be an enhanced and backward compatible database solution.</p> <p>Getting Started with MariaDB is a practical, hands-on, beginner-friendly guide to installing and using MariaDB. This book will start with the installation of MariaDB before moving on to the basics. You will then learn how to configure and maintain your database with the help of real-world examples.</p> <p>Getting Started with MariaDB literally starts at square one by walking you through the basics of what you need to know about MariaDB. This book will teach you how to install MariaDB as well as how to configure it. Following that, you will then be shown how to secure MariaDB. This book will also teach you common commands and will help you learn how to maintain a MariaDB server.</p>
Table of Contents (14 chapters)

Connecting safely


Now that the root user has a password, it's up to us to make sure the password—and the passwords of all other users we will inevitably create—stay secure. One of the most important ways to do that is to always follow a good connection practice.

When connecting to MariaDB as root, or any other user, we tell the mysql command line client that we are connecting with a password by using the -p flag. When we do so we can either specify the password right after the -p flag with no space between, as shown in the following command line:

mysql -u root -pmypassword

Or we can just leave the -p flag by itself and the client will prompt us for the password, as shown in the following command line:

mysql -u root -p 
Enter password:  

It is almost never a good idea to type our password on the command line. The reason is because status and system logs may record the command. This is very useful for determining who is connecting and when, but it can be very dangerous as it exposes the password...