Installation of the MySQL server and client under Ubuntu 14.04

Source: Internet
Author: User
Tags unpack

Now the software is more and more good to install, especially in Ubuntu under the installation of software, there is no skill, just need to use apt-get inatll in the case of networking. Before you decide to install MySQL, determine if the system already has MySQL installed.

[Email protected]:~$ Netstat-tap | grep MySQL (not all processes can be detected, all non-user process information will not be displayed, if you want to see all the information, you must switch to the root user)

It can be seen that the system does not have MySQL installed, execute the following command to install.

[email protected]:~$ sudo apt-get install mysql-server  is reading the package list ...  complete   Parsing a package's dependency tree   reading status information ...  complete   The following additional packages will be installed: libdbd-mysql-perl libdbi-perl  Libhtml-template-perl libmysqlclient18 libterm-readkey-perl mysql-client-5.5 mysql-common  mysql-server-5.5 mysql-server-core-5.5  Recommended Packages for installation:  libmldbm-perl libnet-daemon-perl  libplrpc-perl libsql-statement-perl libipc-sharedcache-perl tinyca mailx  the following "new" Package will be installed: libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18  libterm-readkey-perl mysql-client-5.5 mysql-common mysql-server mysql-server-5.5  mysql-server-core-5.5  upgraded  0  packages, new  10  packages installed, uninstall  0  packages,  158  Packages have not been upgraded.   need to download  8,343 kB  packages.   will consume the extra space of  86.8 MB  after decompression.   Do you want to continue?  [y/n]  sudo apt-get install mysql-server 


Enter y into the installation interface, during the installation process, will pop up an interface required to enter the root of the MySQL password, here must input, save the installation and then set the password.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4C/38/wKiom1Q5TwrD_HDeAAGN_of_IJE149.jpg "title=" 1.png " alt= "Wkiom1q5twrd_hdeaagn_of_ije149.jpg"/>


Enter the password again:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4C/3A/wKioL1Q5T43xLjglAADHLRvfo8Q629.jpg "title=" 2.png " alt= "Wkiol1q5t43xljglaadhlrvfo8q629.jpg"/>


Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-common all  5.5.38-0ubuntu0.14.04.1 [14.1 kb]  Get:2 http://us.archive.ubuntu.com/ubuntu/  trusty-updates/main libmysqlclient18 i386 5.5.38-0ubuntu0.14.04.1 [592 kb]  gets: 3  http://us.archive.ubuntu.com/ubuntu/ trusty/main libdbi-perl i386 1.630-1 [881  kB]  Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main libdbd-mysql-perl  i386 4.025-1 [99.6 kb]  Get: 5 http://us.archive.ubuntu.com/ubuntu/ trusty/main  libterm-readkey-perl i386 2.31-1 [27.2 kB]  Get: 6 http:// us.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-client-5.5 i386  5.5.38-0ubuntu0.14.04.1 [1,433 kb]  Get:7 http://us.archive.ubuntu.com/ubuntu/  trusty-updates/main mysql-server-core-5.5 i386 5.5.38-0ubuntu0.14.04.1 [3,135 kb]  Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main  mysql-server-5.5 i386 5.5.38-0ubuntu0.14.04.1 [2,082 kb]  Get: 9 http:// us.archive.ubuntu.com/ubuntu/ trusty/main libhtml-template-perl all 2.95-1 [65.5  kB]  Get: 10 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server  all 5.5.38-0ubuntu0.14.04.1 [12.4 kB]  download  8,343 kb, time  49 seconds   (168  KB/S)   is pre-set software package  ... Selecting previously unselected package  mysql-common.  (Reading database  ...  system currently has  212184  files and directories installed.) )  Preparing to unpack .../mysql-common_5.5.38-0ubuntu0.14.04.1_all.deb ...  unpacking mysql-common  (5.5.38-0ubuntu0.14.04.1)  ... Selecting previously  Unselected package libmysqlclient18:i386. preparing to unpack&nbsP;.../libmysqlclient18_5.5.38-0ubuntu0.14.04.1_i386.deb ... unpacking libmysqlclient18:i386   (5.5.38-0ubuntu0.14.04.1)  ... Selecting previously unselected package  Libdbi-perl. preparing to unpack .../libdbi-perl_1.630-1_i386.deb ... unpacking  libdbi-perl  (1.630-1)  ... Selecting previously unselected package  LIBDBD-MYSQL-PERL. PREPARING TO UNPACK .../LIBDBD-MYSQL-PERL_4.025-1_I386.DEB&NBSP, .....  Unpacking libdbd-mysql-perl  (4.025-1)  ... selecting previously unselected  package libterm-readkey-perl. preparing to unpack .../libterm-readkey-perl_ 2.31-1_i386.deb ... unpacking libterm-readkey-perl  (2.31-1)  ... Selecting  Previously unselected package mysql-client-5.5. preparing to unpack .../ mysql-client-5.5_5.5.38-0ubuntu0.14.04.1_i386.deb ... unpacking mysql-client-5.5  (5.5.38-0ubuntu0.14.04.1)  ...  Selecting previously unselected package mysql-server-core-5.5. preparing to  unpack .../mysql-server-core-5.5_5.5.38-0ubuntu0.14.04.1_i386.deb ... Unpacking  mysql-server-core-5.5  (5.5.38-0ubuntu0.14.04.1)  ... Processing triggers for  man-db  (2.6.7.1-1)  ...  setting  mysql-common  (5.5.38-0ubuntu0.14.04.1)  ...  selecting previously unselected package mysql-server-5.5.  (Reading Database  ...  The system currently has a total of  212532  files and directories installed. )  Preparing to unpack .../mysql-server-5.5_5.5.38-0ubuntu0.14.04.1_i386.deb ...  unpacking mysql-server-5.5  (5.5.38-0ubuntu0.14.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.5.38-0ubuntu0.14.04.1_all.deb ... unpacking mysql-server  ( 5.5.38-0ubuntu0.14.04.1)  ... Processing triggers for ureadahead  (0.100.0-16)  ... ureadahead will be reprofiled on next reboot processing  triggers for man-db  (2.6.7.1-1)  ...  setting  libmysqlclient18:i386  ( 5.5.38-0ubuntu0.14.04.1)  ...  setting  libdbi-perl  (1.630-1)  ...  setting   libdbd-mysql-perl  (4.025-1)  ...  setting  libterm-readkey-perl  (2.31-1)  ...  setting up  mysql-client-5.5  (5.5.38-0ubuntu0.14.04.1)  ...  setting  mysql-server-core-5.5  ( 5.5.38-0ubuntu0.14.04.1)  ...  Setting  mysql-server-5.5  (5.5.38-0ubuntu0.14.04.1)  ... 16:29:54 [warning] using unique option  prefix key_buffer instead of key_buffer_size is deprecated and  Will be removed in a future release. please use the full  name instead. mysql start/running, process 31215  Setting up   libhtml-template-perl  (2.95-1)  ... Processing triggers for ureadahead  ( 0.100.0-16)  ...  setting  mysql-server  (5.5.38-0ubuntu0.14.04.1)  ... Processing  triggers for libc-bin  (2.19-0ubuntu6.1)  ... mysql server installation process


After the MySQL installation is complete, we can check to see if the system already has the MySQL service by Netstat-tap|grep MySQL.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4C/38/wKiom1Q5T5agERVqAACr7cjhJCg443.jpg "title=" 3.png " alt= "Wkiom1q5t5agervqaacr7cjhjcg443.jpg"/>


The above information appears stating that we have successfully installed MySQL.

You can view the MySQL version by executing the following command:

[Email protected]:~$ mysql-v mysql Ver 14.14 distrib 5.5.38, for Debian-linux-gnu (i686) using ReadLine 6.3


The following is a simple configuration

After the installation is complete, modify the/ETC/MYSQL/MY.CNF (this file is the MySQL profile). Comment out the binding-address=127.0.0.1 in the file. Other configurations are changed as needed.

[Email protected]:~$ sudo vi/etc/mysql/my.cnf# Instead of skip-networking The default is now-listen only on# localhost which are more compatible and are not less secure. #bind-address = 127.0.0.1


Log in to the database:

[Email protected]:~$ msyql-u root-p not found ' msyql ' command, you want to enter is: Command ' MySQL ' comes from package ' percona-xtradb-cluster-client-5.5 ' (univer SE) command ' mysql ' from package ' mysql-client-core-5.5 ' (main) command ' MySQL ' from package ' mariadb-client-core-5.5 ' (Universe) command ' MySQL ' comes from package ' m ysql-client-core-5.6 ' (universe) MSYQL: Command not found


The error occurs because the MySQL client is not installed, and the client that executes the command installs MySQL:

[email protected]:~$ sudo apt-get install mysql-client  is reading the package list ...  complete   Parsing software package dependency Tree   Reading status information ...  complete   The following "new" packages will be installed: mysql-client  upgrade  0  packages, A new  1  package is installed, to uninstall  0  packages, there are  158  packages not upgraded.   need to download  12.3 kB  packages.   will consume the extra space of  129 kB  after decompression.   Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-client all  5.5.38-0ubuntu0.14.04.1 [12.3 kb]  download  12.3 kb, time  1 sec   (10.2 kb/s)   selecting previously unselected package mysql-client.  (Reading database  ...  system currently installed  212633  files and directories. )  Preparing to unpack .../mysql-client_5.5.38-0ubuntu0.14.04.1_all.deb ...  unpacking mysql-client  (5.5.38-0ubuntu0.14.04.1)  ...  setting  mysql-client  ( 5.5.38-0ubuntu0.14.04.1)   [Email protected]:~$ sudo apt-get install mysql-client 


Once the installation is complete, log in to MySQL again:

[email protected]:~$ mysql -u root -p  Enter password: welcome to the mysql monitor. commands end with  ; or \g. your mysql connection id is 43 server version : 5.5.38-0ubuntu0.14.04.1  (Ubuntu)  Copyright  (c)  2000, 2014, 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> 


Configure MySQL remote access by executing the following command:

Mysql> Grant all privileges on * * to [e-mail protected] '% ' identified by ' root '; Query OK, 0 rows affected (0.01 sec)


Restart the MSYQL service for remote access

[Email protected]:~$ sudo service mysql restart MySQL stop/waiting mysql start/running, process 32359


To this installation and configuration is complete.

This article is from the "Forever Love" blog, be sure to keep this source http://dwf07223.blog.51cto.com/8712758/1562758

Installation of the MySQL server and client under Ubuntu 14.04

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.