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
About the Author
About the Reviewers
MariaDB Next Steps

Connecting safely

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

Connecting safely on the command line

When connecting to MariaDB as the root, or any other user from the command line, 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 in between, as shown in the following example:

mysql -u root -pmypassword

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

mysql -u root -p 
Enter password:  

It is almost never a good idea to have our password visible on the command line as in the first example. The reason is that the status and system...