Book Image

CentOS System Administration Essentials

Book Image

CentOS System Administration Essentials

Overview of this book

Table of Contents (18 chapters)
CentOS System Administration Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing MySQL


MySQL is the open source database solution now managed by Oracle, and of course this is a pivotal component of the LEMP stack that we are implementing. The MySQL server can store data to be displayed later on our web pages. We will communicate from Nginx using PHP with the database server. We can use yum to install MySQL and the PHP modules:

# yum install php-mysql mysql-server
# service mysqld start
# chkconfig mysqld on

Once MySQL is installed, we need to secure the installation a little further; even if it is only to set the MySQL root password. Out of the box security in many systems tends to be a little light. Using the mysql_secure_installation command, we can add a little extra security. Running the program will lead you into a simple interactive prompted session:

# mysql_secure_installation

The resulting wizard will prompt you through the process described in the following:

  • Enter current password for root: This is currently blank, so just use the Enter key.

  • Set root...