HostOnNet Blog

Install MySQL Server On Ubuntu

Looking for Linux Server Admin or WordPress Expert? We can help.

1. First you need to login as root.

sudo su

2. Next you need to update and upgrade apt.

apt-get update
apt-get upgrade

3. To install MySQL, run the following command:

apt-get install mysql-server

4. During the installation process you will be prompted to enter a password for the MySQL root user.

Once the installation is complete, the MySQL server should be started automatically.

You can run the following command from a terminal prompt to check whether the MySQL server is running:

$sudo netstat -tap | grep mysql

To start mysql server:

/etc/init.d/mysqld start

To stop mysql server:

/etc/init.d/mysqld stop

To restart mysql server:

/etc/init.d/mysqld restart

To change MySQL Password, run the following command:

mysqladmin -u root password NEWPASSWORD

change “NEWPASSWORD” with your own password.

About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.
Posted in MySQL

Leave a Reply

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

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