How you Install MySQL on Ubuntu server

To Install MySQL on Ubuntu you can  use ‘apt-get ‘ command with ‘ install ‘ option  as shown bellow.

intzar@ubuntu:~$ sudo apt-get install mysql-server

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libterm-readkey-perl mysql-client-5.6
mysql-client-core-5.6 mysql-common mysql-server-5.6 mysql-server-core-5.6
Suggested packages:
libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libterm-readkey-perl mysql-client-5.6
mysql-client-core-5.6 mysql-common mysql-server mysql-server-5.6 mysql-server-core-5.6
0 upgraded, 12 newly installed, 0 to remove and 90 not upgraded.
Need to get 21.5 MB of archives.
After this operation, 150 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ vivid/main libaio1 i386 0.3.110-1 [6,790 B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main mysql-common all 5.6.28-0ubuntu0.15.04.1 [14.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libmysqlclient18 i386 5.6.28-0ubuntu0.15.04.1 [682 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ vivid/main libdbi-perl i386 1.631-3build1 [774 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ vivid/main libdbd-mysql-perl i386 4.028-2 [93.0 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ vivid/main libterm-readkey-perl i386 2.32-1build1 [26.0 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main mysql-client-core-5.6 i386 5.6.28-0ubuntu0.15.04.1 [4,116 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main mysql-client-5.6 i386 5.6.28-0ubuntu0.15.04.1 [5,340 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main mysql-server-core-5.6 i386 5.6.28-0ubuntu0.15.04.1 [4,578 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main mysql-server-5.6 i386 5.6.28-0ubuntu0.15.04.1 [5,766 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu/ vivid/main libhtml-template-perl all 2.95-1 [65.5 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main mysql-server all 5.6.28-0ubuntu0.15.04.1 [8,882 B]
Fetched 21.5 MB in 3min 20s (107 kB/s)
Preconfiguring packages …
Selecting previously unselected package libaio1:i386.
(Reading database … 55792 files and directories currently installed.)
Preparing to unpack …/libaio1_0.3.110-1_i386.deb …
Unpacking libaio1:i386 (0.3.110-1) …
Selecting previously unselected package mysql-common.
Preparing to unpack …/mysql-common_5.6.28-0ubuntu0.15.04.1_all.deb …
Unpacking mysql-common (5.6.28-0ubuntu0.15.04.1) …
Selecting previously unselected package libmysqlclient18:i386.
Preparing to unpack …/libmysqlclient18_5.6.28-0ubuntu0.15.04.1_i386.deb …
Unpacking libmysqlclient18:i386 (5.6.28-0ubuntu0.15.04.1) …
Selecting previously unselected package libdbi-perl.
Preparing to unpack …/libdbi-perl_1.631-3build1_i386.deb …
Unpacking libdbi-perl (1.631-3build1) …
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack …/libdbd-mysql-perl_4.028-2_i386.deb …
Unpacking libdbd-mysql-perl (4.028-2) …
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack …/libterm-readkey-perl_2.32-1build1_i386.deb …
Unpacking libterm-readkey-perl (2.32-1build1) …
Selecting previously unselected package mysql-client-core-5.6.
Preparing to unpack …/mysql-client-core-5.6_5.6.28-0ubuntu0.15.04.1_i386.deb …
Unpacking mysql-client-core-5.6 (5.6.28-0ubuntu0.15.04.1) …
Selecting previously unselected package mysql-client-5.6.
Preparing to unpack …/mysql-client-5.6_5.6.28-0ubuntu0.15.04.1_i386.deb …
Unpacking mysql-client-5.6 (5.6.28-0ubuntu0.15.04.1) …
Selecting previously unselected package mysql-server-core-5.6.
Preparing to unpack …/mysql-server-core-5.6_5.6.28-0ubuntu0.15.04.1_i386.deb …
Unpacking mysql-server-core-5.6 (5.6.28-0ubuntu0.15.04.1) …
Processing triggers for man-db (2.7.0.2-5) …
Setting up mysql-common (5.6.28-0ubuntu0.15.04.1) …
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.6.
(Reading database … 56162 files and directories currently installed.)
Preparing to unpack …/mysql-server-5.6_5.6.28-0ubuntu0.15.04.1_i386.deb …
Unpacking mysql-server-5.6 (5.6.28-0ubuntu0.15.04.1) …
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack …/libhtml-template-perl_2.95-1_all.deb …
Unpacking libhtml-template-perl (2.95-1) …
Selecting previously unselected package mysql-server.
Preparing to unpack …/mysql-server_5.6.28-0ubuntu0.15.04.1_all.deb …
Unpacking mysql-server (5.6.28-0ubuntu0.15.04.1) …
Processing triggers for man-db (2.7.0.2-5) …
Processing triggers for ureadahead (0.100.0-19) …
Processing triggers for systemd (219-7ubuntu3) …
Setting up libaio1:i386 (0.3.110-1) …
Setting up libmysqlclient18:i386 (5.6.28-0ubuntu0.15.04.1) …
Setting up libdbi-perl (1.631-3build1) …
Setting up libdbd-mysql-perl (4.028-2) …
Setting up libterm-readkey-perl (2.32-1build1) …
Setting up mysql-client-core-5.6 (5.6.28-0ubuntu0.15.04.1) …
Setting up mysql-client-5.6 (5.6.28-0ubuntu0.15.04.1) …
Setting up mysql-server-core-5.6 (5.6.28-0ubuntu0.15.04.1) …
Setting up mysql-server-5.6 (5.6.28-0ubuntu0.15.04.1) …
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
2016-04-11 02:34:50 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-11 02:34:50 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28-0ubuntu0.15.04.1) starting as process 5017 …
Setting up libhtml-template-perl (2.95-1) …
Setting up mysql-server (5.6.28-0ubuntu0.15.04.1) …
Processing triggers for libc-bin (2.21-0ubuntu4) …
Processing triggers for ureadahead (0.100.0-19) …
Processing triggers for systemd (219-7ubuntu3) …
intzar@ubuntu:~$

During the installation process, system prompted to set a password for the MySQL root user as shown below.

 Again prompted for password

 Login MySQL as a root User:

intzar@ubuntu:~$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.28-0ubuntu0.15.04.1 (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> 

Now Complete the MySQL Installation process.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s