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 ...

Get CentOS System Administration Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.