Installing MySQL in Ubuntu – A beginners step-by-step guide

1 min

This tutorial will guide you to install MySql in Ubuntu. If you want a guide to install Apache and PHP in Ubuntu before installing MySql, they are available here:
How to install PHP
How to install Apache Web server

Follow these steps on to install MySql in Ubuntu:

1. Open Terminal and run below command.
sudo apt-get install mysql-server

2. Give the root password.
3. Wait for the installation to finish.
4. The installer itself start the MySql server. To check whether the MySql server is running or not, run below command.
sudo netstat -tap | grep mysql

5. To make sure, your MySql installation works fine with Apache and PHP, run below command. It will install necessary modules to connect to a MySql database through PHP using Apache.
sudo apt-get install libapache2-mod-auth-mysql php5-mysql

6. Installation is completed.


Creator and author of Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments