Recommended VPS Complete list of best VPS hosting providers.

How To Build Working CentOS Server with LightTPD and PHP5 (Part 2)

In this part 2 of the tutorial how to build and setup Lighttpd on CentOS server I will try to explain how to install other requirements for a working web server when you can host your websites in it, or at least a WordPress-based blog that requires PHP and MySQL database. In case if you came to this page from search engine, you can catch my previous article, the part 1 of this tutorial here.

Index of this guide: Part 1Part 2Part 3Part 4.

How to Install MySQL 5 on CentOS 6.4

Step 0 – I assumed you’ve followed all the steps in the Part 1. So if at some point you feel confused, go back to read the part 1.

Step 1 – Issue basic command syntax to install MySQL 5 via yum:

yum install mysql mysql-server

It looks like this in the beginning:

yum install mysql

As usual, it will then ask you to confirm. Simply type Y then hit Enter. Once done, you will see the “Complete!” message like this:

mysql installed

Step 2 – Next, this one is optional but very recommended: create system startup links for MySQL so it can start automatically each time and whenever the system boots. Use this simple command:

chkconfig --levels 235 mysqld on

Step 3 – Now lets start MySQL service for the very first time. Issue this familiar command syntax:

/etc/init.d/mysqld start

Step 4 – Caution, this step is very important step to setting up MySQL. You’ll need to define the password to use MySQL as root. Use this command:


You’ll see something like this:

setup mysql

It asks you “Enter current password for root (enter for none):” In this point you can simply hit Enter.

Next, it will also ask you to set root password. Type Y then hit Enter. Now you can type the new password for root user.

install mysql

Next question you have to answer is “Remove anonymous users? [Y/n]”. At this point simply type Y and hit Enter.

Another question is “Disallow root login remotely? [Y/n]”. Again, simply type Y and hit Enter.

When you asked “Remove test database and access to it? [Y/n]”. Again, simply type Y and hit Enter.

The last question is “Reload privilege tables now? [Y/n]”. Again, simply type Y and hit Enter.

install mysql

That’s it. You can read my previous guide about top common MySQL commands you better know it to help you with basic MySQL operations.

Index of this guide: Part 1Part 2Part 3Part 4.

Next Part 3:

How to Install PHP5 with FPM on CentOS with Lighttpd server.

Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.