apt-get Install mysql server

How do you install mysql server in Linux using apt-get command?

How to Install mysql server with apt-get?

apt-get install mysql server -y

Install Mysql Server  Command

Here is a tutorial to learn how to install mysql server using apt-get command.

Step 1: Open terminal with su access and enter the command as shown below:
apt-get install mysql server -y

Step 2: After completion, the install command exits and instructs the user to restart the running instances of mysql server if it is running already.

Result of the Command Execution shown below:

root@hiox:~ apt get install mysql server  y
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libjna java libsm dev libatk1.0 0 jsvc libts 0.0 0 libpcsclite1
libjaxp1.3 java gconf2 common libgtk2.0 common libdb je java libxfixes3
junit4 libnb apisupport1 java hicolor icon theme libxcomposite1 libice dev
liboro java libappframework java ttf dejavu extra liblcms1
libnb javaparser java libdb4.7 java libxerces2 java xfonts encodings
libgcj bc gcj 4.4 base libgudev 1.0 0 libpthread stubs0 libjtidy java
libjzlib java libatk1.0 data libicu4j java libfreemarker java
libservlet2.4 java ttf dejavu core libdb4.7 java gcj
libcommons beanutils java junit icedtea netx libasm2 java default jdk doc
libnm util1 libnb platform devel java gconf2 java common javahelp2 librrd4
icedtea 6 jre cacao gcj 4.4 jre lib libnspr4 0d libswingx java
default jre headless libcairo2 gnome keyring subversion openvpn blacklist
libcommons logging java jetty xfonts utils libcommons compress java
openjdk 6 jre lib libthai data x11proto kb dev libswingworker java libgcj10
jruby1.1 libdirectfb 1.2 0 libsvn1 libdatrie1 openjdk 6 jre headless
xtrans dev fontconfig libavahi common data libxfont1 libgconf2 4 libffi5 ant
libpango1.0 common x11proto input dev libnb platform11 java libgp11 0
default jdk libjsch java libsvn java libgcr0 libpixman 1 0 libjetty java doc
libcups2 libxml commons resolver1.1 java libpkcs11 helper1 libcobertura java
default jre ant optional libxinerama1 libgif4 libcommons net java libxft2
fontconfig config libnm glib2 libxt dev tzdata java libevent 1.4 2 libice6
libthai0 libidl0 libneon27 gnutls libglade2 0 liblzo2 2 libasound2 libflac8
libnb java3 java libservlet2.5 java libxrender1 openssl blacklist
libservlet2.3 java libvorbisenc2 libxau dev x ttcidfont conf libslf4j java
libcommons daemon java libnfsidmap2 libtiff4 libfontenc1 libjasper1
libswing layout java ttf dejavu libregexp java libgnome keyring0 libxtst6
liborbit2 tsconf libavahi client3 x11 common libsysfs2 ant optional gcj
librpcsecgss3 libfontconfig1 ca certificates java libhamcrest java
liblucene2 java libpango1.0 0 libsm6 libpulse0 libx11 dev openjdk 6 doc
libxdamage1 libcommons collections3 java libbeansbinding java libgcj common
openvpn netcat traditional libxcb render0 libgtk2.0 bin dbus x11 libxi6
libvorbis0a libxcb1 dev libgssglue1 openjdk 6 jdk ant gcj
libcommons digester java libxcursor1 libxt6 portmap libini4j java
libjetty java openjdk 6 jre defoma libavahi common3 libpam gnome keyring
liblog4j1.2 java libxcb render util0 libnb svnclientadapter java
libjline java libxrandr2 libnss3 1d x11proto core dev libsndfile1
libgtk2.0 0 libnb ide12 java libxdmcp dev libpthread stubs0 dev libogg0
Use 'apt get autoremove' to remove them.
The following extra packages will be installed:
libdbd mysql perl libdbi perl libhtml template perl libnet daemon perl
libplrpc perl mysql client 5.1 mysql client core 5.1 mysql server 5.1
mysql server core 5.1
Suggested packages:
dbishell libipc sharedcache perl tinyca
The following NEW packages will be installed:
libdbd mysql perl libdbi perl libhtml template perl libnet daemon perl
libplrpc perl mysql client 5.1 mysql client core 5.1 mysql server
mysql server 5.1 mysql server core 5.1
0 upgraded, 10 newly installed, 0 to remove and 90 not upgraded.
Need to get 22.3MB of archives.
After this operation, 56.5MB of additional disk space will be used.
Get:1 http://old releases.ubuntu.com/ubuntu/ lucid/main libnet daemon perl 0.43 1 [46.9kB]
Get:2 http://old releases.ubuntu.com/ubuntu/ lucid/main libplrpc perl 0.2020 2 [36.0kB]
Get:3 http://old releases.ubuntu.com/ubuntu/ lucid/main libdbi perl 1.609 1build1 [801kB]
Get:4 http://old releases.ubuntu.com/ubuntu/ lucid/main libdbd mysql perl 4.012 1ubuntu1 [137kB]
Get:5 http://old releases.ubuntu.com/ubuntu/ lucid updates/main mysql client core 5.1 5.1.73 0ubuntu0.10.04.1 [166kB]
Get:6 http://old releases.ubuntu.com/ubuntu/ lucid updates/main mysql client 5.1 5.1.73 0ubuntu0.10.04.1 [8,817kB]
Get:7 http://old releases.ubuntu.com/ubuntu/ lucid updates/main mysql server core 5.1 5.1.73 0ubuntu0.10.04.1 [5,046kB]
Get:8 http://old releases.ubuntu.com/ubuntu/ lucid updates/main mysql server 5.1 5.1.73 0ubuntu0.10.04.1 [7,111kB]
Get:9 http://old releases.ubuntu.com/ubuntu/ lucid/main libhtml template perl 2.9 1 [65.8kB]
Get:10 http://old releases.ubuntu.com/ubuntu/ lucid updates/main mysql server 5.1.73 0ubuntu0.10.04.1 [68.8kB]
Preconfiguring packages ...
[?1049h[1;40r[4l[?25l[m(B[37m[40m[1;40r[H[2J[1;1H[1m[37m[44m[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[1;1H[?25l[?12l[?25h[m(B[37m[44mPackage configuration[15;27H[30m[47m îå îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ î§ [31mConfiguring mysql server 5.1[30m  îú îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îê[16;27H îÇ While not mandatory, it is highly recommended that you set a password for the MySQL administrative "root" user.  îÇ[1m[37m[40m [17;27H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [18;27H[m(B[30m[47m îÇ If this field is left blank, the password will not be changed.  îÇ[1m[37m[40m [19;27H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [20;27H[m(B[30m[47m îÇ New password for the MySQL "root" user:  îÇ[1m[37m[40m [21;27H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [22;27H[m(B[30m[47m îÇ [37m[44m________________________________________________________________________________________________________________[30m[47m  îÇ[1m[37m[40m [23;27H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [24;27H[m(B[30m[47m îÇ <Ok>  îÇ[1m[37m[40m [25;27H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [26;27H[m(B[30m[47m îî îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îò[1m[37m[40m [27;28H [22;29H[m(B[37m[44m****[?25l[?12l[?25h[40;1H[40m[m(B[39;49m[K[?1049l[?1049h[1;40r[4l[?25l[m(B[37m[40m[1;40r[H[2J[1;1H[1m[37m[44m[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[1;1H[?25l[?12l[?25h[m(B[37m[44mPackage configuration[16;62H[30m[47m îå îÄ îÄ îÄ îÄ îÄ îÄ î§ [31mConfiguring mysql server 5.1[30m  îú îÄ îÄ îÄ îÄ îÄ îÄ îÄ îê[17;62H îÇ  îÇ[1m[37m[40m [18;62H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [19;62H[m(B[30m[47m îÇ Repeat password for the MySQL "root" user:  îÇ[1m[37m[40m [20;62H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [21;62H[m(B[30m[47m îÇ [37m[44m___________________________________________[30m[47m  îÇ[1m[37m[40m [22;62H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [23;62H[m(B[30m[47m îÇ <Ok>  îÇ[1m[37m[40m [24;62H[m(B[30m[47m îÇ  îÇ[1m[37m[40m [25;62H[m(B[30m[47m îî îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îÄ îò[1m[37m[40m [26;63H [21;64H[m(B[37m[44m****[?25l[?12l[?25h[40;1H[40m[m(B[39;49m[K[?1049lFetched 22.3MB in 4s (5,309kB/s)
Selecting previously deselected package libnet daemon perl.
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 52608 files and directories currently installed.)
Unpacking libnet daemon perl (from .../libnet daemon perl_0.43 1_all.deb) ...
Selecting previously deselected package libplrpc perl.
Unpacking libplrpc perl (from .../libplrpc perl_0.2020 2_all.deb) ...
Selecting previously deselected package libdbi perl.
Unpacking libdbi perl (from .../libdbi perl_1.609 1build1_amd64.deb) ...
Selecting previously deselected package libdbd mysql perl.
Unpacking libdbd mysql perl (from .../libdbd mysql perl_4.012 1ubuntu1_amd64.deb) ...
Selecting previously deselected package mysql client core 5.1.
Unpacking mysql client core 5.1 (from .../mysql client core 5.1_5.1.73 0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package mysql client 5.1.
Unpacking mysql client 5.1 (from .../mysql client 5.1_5.1.73 0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package mysql server core 5.1.
Unpacking mysql server core 5.1 (from .../mysql server core 5.1_5.1.73 0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package mysql server 5.1.
Unpacking mysql server 5.1 (from .../mysql server 5.1_5.1.73 0ubuntu0.10.04.1_amd64.deb) ...
Selecting previously deselected package libhtml template perl.
Unpacking libhtml template perl (from .../libhtml template perl_2.9 1_all.deb) ...
Selecting previously deselected package mysql server.
Unpacking mysql server (from .../mysql server_5.1.73 0ubuntu0.10.04.1_all.deb) ...
Processing triggers for man db ...
Processing triggers for ureadahead ...
Setting up libnet daemon perl (0.43 1) ...
Setting up libplrpc perl (0.2020 2) ...
Setting up libdbi perl (1.609 1build1) ...
Setting up libdbd mysql perl (4.012 1ubuntu1) ...
Setting up mysql client core 5.1 (5.1.73 0ubuntu0.10.04.1) ...
Setting up mysql client 5.1 (5.1.73 0ubuntu0.10.04.1) ...
Setting up mysql server core 5.1 (5.1.73 0ubuntu0.10.04.1) ...
Setting up mysql server 5.1 (5.1.73 0ubuntu0.10.04.1) ...
mysql start/running, process 16155

Setting up libhtml template perl (2.9 1) ...
Setting up mysql server (5.1.73 0ubuntu0.10.04.1) ...
Processing triggers for libc bin ...
ldconfig deferred processing now taking place
root@hiox:~-


Related Topics

Apt Get Commands